-
-
Notifications
You must be signed in to change notification settings - Fork 924
Labels
A-linterArea - LinterArea - Linter
Description
What happened?
Complex code block can break jsdoc parsing.
E.g.:
/**
* Handle whitespace rendering based on meta string
*
* `` ```js :whitespace[=all|boundary|trailing] ``
*
* @param parser - Code parser instance
* @param meta - Meta string
* @param globalOption - Global whitespace option
*
* @example
* ```ts
* import { metaWhitespace } from '@vuepress/plugin-prismjs'
*
* metaWhitespace(parser, ':whitespace=all', true)
* ```
*/
export const metaWhitespace = (
parser: CodeParser,
meta: string,
globalOption: WhitespacePosition | true = true,
): void => {
const position = resolveWhitespacePosition(meta, globalOption)
if (!position) return
parser.line((line) => {
renderWhitespaceInLine(line, position)
})
}
If the following line is removed:
`` ```js :whitespace[=all|boundary|trailing] ``
(Note: This is a valid markdown => ```js :whitespace[=all|boundary|trailing], double `` is needed as there is a ``` inside.)
Then everything will be fine again.
Unfortunately, we need the following jsdoc:
P.S.: For more details on these tricks, refer to the CommonMark spec. Markdown can express any content thanks to its complete escaping mechanism.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
Type
Fields
Give feedbackPriority
None yet
Effort
None yet