jsdoc-to-markdown icon indicating copy to clipboard operation
jsdoc-to-markdown copied to clipboard

"|" symbol in parameter description is not escaped

Open SkeLLLa opened this issue 8 years ago • 4 comments

Hello. When jsdoc @param or @returns have description that contains | symbol it will be not escaped properly and could break table layout.

SkeLLLa avatar Jan 04 '17 11:01 SkeLLLa

hi! In that case, try rendering your docs using --no-gfm. This mode avoids using github-flavoured markdown, using html in most cases. This prevents table layout being broken.

75lb avatar Jan 04 '17 11:01 75lb

@75lb, it worked, thanks. But I think it would be a good idea to replace such char with | or something similar.

SkeLLLa avatar Jan 04 '17 14:01 SkeLLLa

&#124 is used in all cases where a | is generated by the tool, however i don't believe jsdoc2md looks for (and replaces) | characters in user-generated descriptions.. I will check tonight.

75lb avatar Jan 04 '17 14:01 75lb

Was this ever further investigated? I see an issue as well when I try to document multiple types for a function parameter.

/**
 * Build a span that will link to results, applies class 'mun_launch_results' for jQuery Click handlers
 * @param {(string|number)} id - The ID to use
 * @return {String}
 */
export const getResultsLinkSpan = (id) => `<span id="${id}">Test</span>`;

EDIT: Actually, I think this is due to the rendering of MarkDown by our version of GitLab. It appears fine when previewing it in VSCode.

kczx3 avatar Mar 07 '18 19:03 kczx3