Skip to content

Un-escaped HTML tags may cause markdown renderers to render the HTML #697

@rwols

Description

@rwols

Some docstrings contain HTML, but they should be escaped. e.g. hover over a react-router-dom Link component and the response is

:: [20:21:32.099] --> LSP-typescript textDocument/hover (1615): {'textDocument': {'uri': 'file:///media/Work/code/vault/src/routes/Root.tsx'}, 'position': {'character': 22, 'line': 14}}


: [20:21:32.102] <<< LSP-typescript (1615) (duration: 2ms): {'contents': {'kind': 'markdown', 'value': '\n```typescript\n(alias) const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>\nimport Link\n```\nThe public API for rendering a history-aware <a>.'}, 'range': {'end': {'character': 23, 'line': 14}, 'start': {'character': 19, 'line': 14}}}

In the markdown value, should the < and > in React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>> as well as in <a> be escaped? I think they should be escaped, since markdown may contain HTML for markup.

Metadata

Metadata

Assignees

No one assigned

    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