Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent compiler behaviour #355

Open
omgMath opened this issue Dec 10, 2020 · 0 comments
Open

Inconsistent compiler behaviour #355

omgMath opened this issue Dec 10, 2020 · 0 comments

Comments

@omgMath
Copy link

omgMath commented Dec 10, 2020

Due to migration reasons we've ended up rendering only HTML. We've noted sometimes the content is rendered in additional <p> </p> tags, resulting in invalid HTML.

Strangely that happens every second time, i.e.

const {compiler} = require("markdown-to-jsx");
for (let i = 0; i < 2; i++) {
    const compiled = compiler("<p>From 20. to 22.12.</p>");
    console.log(compiled.props.children);
    console.log("----------------");
}

results in the following output:

[
  {
    '$$typeof': Symbol(react.element),
    type: 'p',
    key: '0',
    ref: null,
    props: { className: undefined, children: [Array] },
    _owner: null,
    _store: {}
  }
]
----------------
[ 'From 20. to 22.12.' ]
----------------

Altough we are not yet using 7.1.0, it also occurs there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant