HTML comments in Markdown break HTML page generation #231

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

Comments

Projects
None yet
3 participants
@staltz
Contributor

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 -->.

staltz added a commit to staltz/esdoc that referenced this issue Mar 3, 2016

h13i32maru added a commit that referenced this issue Mar 6, 2016

Merge pull request #239 from staltz/patch-1
Fix bug #231 with HTML comments
@h13i32maru

This comment has been minimized.

Show comment
Hide comment
@h13i32maru

h13i32maru Mar 6, 2016

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@staltz

staltz Mar 6, 2016

Contributor

Thanks for accepting PRs :)

Contributor

staltz commented Mar 6, 2016

Thanks for accepting PRs :)

@guiguan

This comment has been minimized.

Show comment
Hide comment
@guiguan

guiguan 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.

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