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

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

Closed
JosephDenman opened this issue May 10, 2024 · 2 comments
Labels

Comments

@JosephDenman
Copy link

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.

@tgreyuk
Copy link
Member

tgreyuk commented May 15, 2024

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

@JosephDenman
Copy link
Author

Thank you!

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

No branches or pull requests

2 participants