typedoc2md/typedoc-plugin-markdown

`sanitizeComments` doesn't add escape characters in front of `<` characters in JSDoc comments

Closed this issue · 2 comments

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

I have a comment in a d.ts file in my project that reads:

/**
 * There are different *classes* of state values:
 *
 * - `null`
 * - Cells of {@link AlignedValue}s
 * - Maps from {@link AlignedValue}s to state values
 * - Bounded Merkle trees containing {@link AlignedValue} leaves
 * - Short (<= 15 element) arrays of state values
 *
 * State values are *immutable*, any operations that mutate states will return
 * a new state instead.
 */

My package.json file looks like this:

  "devDependencies": {
    "typedoc": "^0.25.2",
    "typedoc-plugin-markdown": "^4.0.1"
  }

The output of running typedoc with the above configuration is processed by Docusaurus. The problem we're having is that Docusaurus interpreters < characters as the beginning of HTML tags.

TypeDoc configuration

{
"name": "name of my project",
"out": "path to documentation out directory",
"plugin": ["typedoc-plugin-markdown"],
"entryPoints": ["path to d.ts file"],
"hideGenerator": true,
"disableSources": true,
"excludeExternals": false,
"visibilityFilters": {
  "external": true
},
"sanitizeComments": true,
"includeVersion": true,
"useCodeBlocks": true,
"expandObjects": true
}

Expected behavior

Adding sanitizeComments: true should add an escape \ character in front of the < character, but it doesn't.

Thank you. Fixed in typedoc-plugin-markdown@4.0.2.

Thank you!