microsoft / tsdoc

A doc comment standard for TypeScript
https://tsdoc.org/
MIT License
4.74k stars 131 forks source link

Escape @ symbol in @example code block #216

Closed tristanMatthias closed 4 years ago

tristanMatthias commented 4 years ago

Problem

Currently, the @ breaks styling if used inside the @example+```...```

Example

/**
 * GraphQL JSON type
 *
 * @example
 * ```ts
 *  import { Field, InputType } from 'type-graphql';
 *  import API from '@brix/api';
 *
 *  @InputType()
 *  export class EExampleInput {
 *    @Field(() => String)
 *    type: string;
 *
 *    @Field(() => API.GraphQLJSON)
 *    data: Object;
 *  }
 * ```
 */

Here the @brix/api breaks, and also the decorators

Example VSCode hover preview:

image

brokenmass commented 4 years ago

Can anyone look into this issue ?

octogonz commented 4 years ago

I just pasted this code sample into the TSDoc Playground and it renders correctly.

Example VSCode hover preview:

As far as I know, VS Code's syntax highlighter does not use the @microsoft/tsdoc reference parser. Thus we cannot fix it here. VS Code would need to fix it on their end.

The GitHub project for VS Code is here: https://github.com/microsoft/vscode