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

Pipe character is not escaped in type description #286

Closed
roaringUnicorn opened this issue Jan 20, 2022 · 3 comments
Closed

Pipe character is not escaped in type description #286

roaringUnicorn opened this issue Jan 20, 2022 · 3 comments

Comments

@roaringUnicorn
Copy link

roaringUnicorn commented Jan 20, 2022

Repro case https://github.com/roaringUnicorn/typedoc-plugin-markdown-repro

Type definition

export type ApiResponse = {
    /**
     This pipe will not be escaped: { 'dataIDs': 'ok'|'ko' }
     */
    dataIDs: { [dataId: string]: 'ok' | 'ko' }
    /**
     * This will be fine: { 'itemIDs': 'ok'\| 'ko' }
     */
    itemIDs: { [itemId: string]: 'ok' | 'ko' }
    /**
     * An ugly solution:  { 'userIDs': 'ok' | 'ko' }
     */
    userIDs: { [userId: string]: 'ok' | 'ko' }
}

Generated markdown

The generated markdown:

| Name | Type | Description |
| :------ | :------ | :------ |
| `dataIDs` | `Object` | This pipe will not be escaped: { 'dataIDs': 'ok'|'ko' } |
| `itemIDs` | `Object` | This will be fine: { 'itemIDs': 'ok'\| 'ko' } |
| `userIDs` | `Object` | An ugly solution:  { 'userIDs': 'ok' | 'ko' } |

Problem

The | char in dataIDs description is not escaped. The two next rows are shown correctly.
The | character is interpreted as the end of the row in the table
image

@tgreyuk
Copy link
Member

tgreyuk commented Jan 20, 2022

Sure will have a look at escaping pipes inside comments here. Actually you have highlighted the fact the the there is no object detail - should be something like this i think...

Screenshot 2022-01-20 at 22 34 14

@arantes555
Copy link

Hello @tgreyuk ! Is there any progress on this ?

@tgreyuk
Copy link
Member

tgreyuk commented Feb 5, 2022

Pipes will now be escaped in typedoc-plugin-markdown@3.11.13 . Note that 'ok'\| 'ko' will now get double escaped so will be broken).

@arantes555 have also expanded objects as per example.

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

No branches or pull requests

3 participants