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

[V2] Parse error occur when heading contains < in mdx #2157

Closed
Kimi-Gao opened this issue Dec 29, 2019 · 2 comments · Fixed by #2236
Closed

[V2] Parse error occur when heading contains < in mdx #2157

Kimi-Gao opened this issue Dec 29, 2019 · 2 comments · Fixed by #2236
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR.

Comments

@Kimi-Gao
Copy link

🐛 Bug Report

My docs site has broken since 2.0.0-alpha.40, if the heading(h1, h2, ...) contains <, <= in mdx , it will break when run yarn build but it works fine in the development environment.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Add this line in mdx:
## node < 8
....

or

## node &lt; 8
....
  1. Run yarn build

Expected behavior

build success

Actual Behavior

image

image

Reference

#2116

@Kimi-Gao Kimi-Gao added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Dec 29, 2019
@Kimi-Gao Kimi-Gao changed the title Parse error occur when heading contains < in mdx [V2] Parse error occur when heading contains < in mdx Dec 29, 2019
@endiliey endiliey added good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR. and removed status: needs triage This issue has not been triaged by maintainers labels Jan 1, 2020
@endiliey
Copy link
Contributor

endiliey commented Jan 1, 2020

Alpha40 introduced a html parser that validates HTML.

Adding

    minifyJS: true,
+ continueOnParseError: true,

will let it the build pass, but its quite weird that this shows as parse error if not toggled. Any help is appreciated 😉

Maybe previously we're never HTML spec compliant

@edwandr
Copy link
Contributor

edwandr commented Jan 13, 2020

After investigation i think it was related to the way EJS template was written : by using an escaped HTML tag instead of unescaped (cf https://github.com/tj/ejs#features) the build passed with a special character in title.

I've created a pull request, @endiliey do you think it's a good solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants