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

HTML comments in Markdown break HTML page generation #231

Closed
staltz opened this issue Feb 26, 2016 · 3 comments
Closed

HTML comments in Markdown break HTML page generation #231

staltz opened this issue Feb 26, 2016 · 3 comments

Comments

@staltz
Copy link
Contributor

@staltz staltz commented Feb 26, 2016

I noticed that if I use <!-- comment --> in markdown files used for the Manual, I get an error when building the whole page:

/Users/amed/Development/RxJSNext/node_modules/esdoc/node_modules/ice-cap/out/src/IceCap.js:339
              throw _iteratorError;
              ^

TypeError: Cannot read property '1' of null
Please report this to https://github.com/chjj/marked.
    at Object.sanitizer (/Users/amed/Development/RxJSNext/node_modules/esdoc/out/src/Publisher/Builder/util.js:92:44)
    at InlineLexer.output (/Users/amed/Development/RxJSNext/node_modules/esdoc/node_modules/marked/lib/marked.js:612:26)
    at Parser.tok (/Users/amed/Development/RxJSNext/node_modules/esdoc/node_modules/marked/lib/marked.js:1075:50)
    at Parser.parse (/Users/amed/Development/RxJSNext/node_modules/esdoc/node_modules/marked/lib/marked.js:935:17)
    at Function.Parser.parse (/Users/amed/Development/RxJSNext/node_modules/esdoc/node_modules/marked/lib/marked.js:922:17)
    at marked (/Users/amed/Development/RxJSNext/node_modules/esdoc/node_modules/marked/lib/marked.js:1218:19)
    at markdown (/Users/amed/Development/RxJSNext/node_modules/esdoc/out/src/Publisher/Builder/util.js:86:42)
    at ManualDocBuilder._convertMDToHTML (/Users/amed/Development/RxJSNext/node_modules/esdoc/out/src/Publisher/Builder/ManualDocBuilder.js:295:39)
    at /Users/amed/Development/RxJSNext/node_modules/esdoc/out/src/Publisher/Builder/ManualDocBuilder.js:212:30
    at /Users/amed/Development/RxJSNext/node_modules/esdoc/out/src/Publisher/Builder/ManualDocBuilder.js:228:13

We actually really need HTML comments because we run code in markdown using https://github.com/Widdershin/markdown-doctest, and sometimes we need to skip test for a particular code example, using the comment <!-- skip-example -->.

@h13i32maru
Copy link
Member

@h13i32maru h13i32maru commented Mar 6, 2016

Thanks this issue.
I released the v0.4.6 that fixes this bug.

@h13i32maru h13i32maru closed this Mar 6, 2016
@staltz
Copy link
Contributor Author

@staltz staltz commented Mar 6, 2016

Thanks for accepting PRs :)

@guiguan
Copy link

@guiguan guiguan commented Feb 4, 2017

@staltz @h13i32maru Guys, I run into this error with the latest esdoc. I have a <!-- comment --> in my project's README.md. Here is the output:

resolve: extends chain
resolve: necessary
resolve: access
resolve: unexported identifier
resolve: undocument identifier
resolve: duplication
resolve: ignore
resolve: link
resolve: markdown in description
resolve: test relation
output: badge.svg
output: identifiers.html

TypeError: Cannot read property '1' of null
Please report this to https://github.com/chjj/marked.
    at Object.sanitizer (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/esdoc/out/src/Publisher/Builder/util.js:89:46)
    at InlineLexer.output (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/marked/lib/marked.js:612:26)
    at Parser.tok (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/marked/lib/marked.js:1075:50)
    at Parser.parse (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/marked/lib/marked.js:935:17)
    at Function.Parser.parse (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/marked/lib/marked.js:922:17)
    at marked (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/marked/lib/marked.js:1219:19)
    at markdown (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/esdoc/out/src/Publisher/Builder/util.js:80:41)
    at IndexDocBuilder._buildIndexDoc (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/esdoc/out/src/Publisher/Builder/IndexDocBuilder.js:73:44)
    at IndexDocBuilder.exec (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/esdoc/out/src/Publisher/Builder/IndexDocBuilder.js:49:30)
    at publish (/Users/guiguan/Documents/Projects/SBS/dbenvy-ci-controller/node_modules/esdoc/out/src/Publisher/publish.js:146:58)

If I remove that comment in README.md, it works.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.