Skip to content

Markdown Example code containing @ character does not render properly #51101

Closed
@aetzlecx

Description

@aetzlecx

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.71.2
  • OS Version: Linux x64 5.19.11-100.fc35.x86_64

Steps to Reproduce:

Create any Typescript or JavaScript file and place a JSDoc containing code

The following TS/JS examples work well:

/**
 * @example
 * ```ts
 * function test() {
 * }
 *
 * ```
 */
export class GoodExample {

}
/**
 * @example
 * ```js
 * function test() {
 * }
 *
 * ```
 */
export class GoodExample {

}

However when using a decorator inside of the code example the rendering will break:

/**
 * @example
 * ```ts
 * @decorator
 * function test() {
 * }
 *
 * ```
 */
export class BadExample {

}
/**
 * @example
 * ```js
 * @decorator
 * function test() {
 * }
 *
 * ```
 */
export class BadExample {

}

It looks like that the @decorator is picked up as a jsdoc directive rather than something that's ignored:
image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions