Skip to content

[api-documenter] Regression in Table Cells escaping with latest version #4586

Open
@Lightning00Blade

Description

@Lightning00Blade

Summary

Then running generation of docs I want to have custom escaping for Table cells.

Repro steps

Create a SpecialCustomMarkdownEmitter that extends CustomMarkdownEmitter.
Provide getTableEscapedText with custom escape mechanism:

export class CustomMarkdownEmitter extends ApiFormatterMarkdownEmitter {
    getTableEscapedText(text) {
        // Remove special notes as they can't be rendered in the table view
        return text.replace(/^:::$/g, '').replace(/^:::[A-Za-z]+$/g, '');
    }
}

Expected:
The TableCell generated don't include ::: or text starting with :::
Actual:
The TableCell include the aforementioned things.

Details

This is the Pr that introduced the regression - #4578

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-documenter version? 7.24.0
Operating system? Linux
Documentation target? Markdown
Would you consider contributing a PR? No
TypeScript compiler version? 5.3.3
Node.js version (node -v)? 20.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as intendedpriorityThe maintainers consider it to be an important issue. We should try to fix it soon.

    Type

    No type

    Projects

    Status

    Waiting for Author

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions