jsdoc2md / dmd

The default output template for jsdoc2md
MIT License
38 stars 49 forks source link

Pipes aren't escaped in param tables #43

Closed saltire closed 7 years ago

saltire commented 7 years ago

If a pipe is enclosed in a param type, e.g. {number|string}, it will be treated as a delimiter for the table, and the types will be split into different cells. You can see this here: https://github.com/jsdoc2md/jsdoc-to-markdown/blob/master/docs/API.md (jsdoc2md.render() > options.plugin)

Looks like this was fixed before by replacing \| with &#124;, but I guess Github changed how they parse Markdown. I think if the &#124; is enclosed in the <code> tag, it will render properly: https://stackoverflow.com/questions/17319940/how-to-escape-a-pipe-char-in-a-code-statement-in-a-markdown-table/17320389#17320389.

Looked into fixing the partial myself, but wasn't confident I could do it without breaking other parts of the template...

75lb commented 7 years ago

oo, yes you're right - this is caused by a change in the Github markdown parser! Will look into it.. Thanks for letting me know.

btw, I have a testbed project but it has no documentation at all, i should change that.

75lb commented 7 years ago

fixed and released in dmd v3.0.3, please update jsdoc2md.. thanks again.

saltire commented 7 years ago

Thank you!