Skip to content

Add support for supportsHtml on markdown strings #1344

Closed

Description

@DanTup

VS Code is getting a flag on MarkdownString to say whether (some basic subset of) HTML can be rendered in addition to markdown:

microsoft/vscode#40607

I think it would be useful to support in LSP for the same reason it makes sense there. Some languages let users write their docs in Markdown and they might also include some HTML, but right now it renders literally in the tooltips which is unexpected.

Activity

  1. felixfbecker commented on Sep 8, 2021

    @felixfbecker

    Note also that both the very original Markdown invention and the CommonMark spec (the de-facto Markdown standard) clearly allow HTML within Markdown, it's a core part of the idea behind Markdown. I.e. this is not a non-standard syntax "extension".

  2. dbaeumer commented on Sep 16, 2021

    @dbaeumer
    Member

    It does make sense to add this to LSP. However a client needs to announce the list of supported HTML tags. For VS Code they are defined here: https://github.com/microsoft/vscode/blob/6d2920473c6f13759c978dd89104c4270a83422d/src/vs/base/browser/markdownRenderer.ts#L296

  3. dbaeumer commented on Sep 16, 2021

    @dbaeumer
    Member

    PR welcome.

  4. dbaeumer commented on Nov 2, 2021

    @dbaeumer
    Member

    Implemented and added to the spec.

  5. DanTup commented on Jan 17, 2022

    @DanTup
    ContributorAuthor

    Dirk Bäumer (@dbaeumer) how does this support work? In 14f7c98 I see the client can advertise which tags it supports, but I don't see a way of passing supportsHtml on the MarkdownString to VS Code. Does it require changes in the LSP Client to set this?

  6. dbaeumer commented on Jan 17, 2022

    @dbaeumer
    Member

    For VS Code this is handled the same way as isTrusted. You specify whether this is supported via a setting in the client options. See https://github.dev/microsoft/vscode-languageserver-node/blob/e22c9bdd485d36b77cdf70fd4b34e6928822ebfe/client/src/common/client.ts#L579

  7. DanTup commented on Jan 17, 2022

    @DanTup
    ContributorAuthor

    Ah, got it - thanks!

  8. DanTup commented on Mar 1, 2022

    @DanTup
    ContributorAuthor

    Dirk Bäumer (@dbaeumer) I don't suppose there's an approx ETA for 3.17? I thought I saw it noted in previous VS Code release notes as being published, but the site still shows 3.16 as current.

  9. dbaeumer commented on Mar 1, 2022

    @dbaeumer
    Member

    It is not publish. We did publish new next releases with proposed support for notebooks.

  10. dbaeumer commented on Mar 1, 2022

    @dbaeumer
    Member

    The plan is to have a new 3.17 release the next ~ 2 month

  11. DanTup commented on Mar 1, 2022

    @DanTup
    ContributorAuthor

    Got it, thanks! :)

  12. thw0rted commented on Mar 31, 2022

    @thw0rted

    Just to check as a user who wants to consume documentation that uses inline HTML, when the new release comes out in 2 months, tags should no longer disappear in VSCode Intellisense results?

    I'm having trouble finding my original issue, but I came here from microsoft/vscode#40607 -- that was resolved last year but hasn't fixed the rendering problem; I think it was only part of the puzzle.

    ETA: as an end user, how do I check what version of LSP I have? It's not part of the VSCode "About" dialog.

  13. KamasamaK commented on Mar 31, 2022

    @KamasamaK
    Contributor

    James Bromwell (@thw0rted) The LSP client is not a part of core VS Code. The language extension would use vscode-languageclient. In order to use this new feature, it will need to use v8.0.0-next.5 or later.

  14. thw0rted commented on Apr 1, 2022

    @thw0rted

    Thanks for the link. Do you know (or know how to tell) when that lands in a VSCode release? I'm just trying to figure out when the symptom (large portions of some docs are completely removed) is going to be resolved for end users, without getting passed around between the Language Service people and the VSCode people and the TypeScript people.

  15. KamasamaK commented on Apr 1, 2022

    @KamasamaK
    Contributor

    James Bromwell (@thw0rted) As far as I can see, the bundled typescript-language-features extension doesn't even use the LSP client. The issue you're describing would be with that bundled extension and possibly extends to the TypeScript language service it uses. It's not an issue with the LSP spec or that LSP client.

  16. DanTup commented on Apr 21, 2022

    @DanTup
    ContributorAuthor

    Dirk Bäumer (@dbaeumer)

    The plan is to have a new 3.17 release the next ~ 2 month

    We're approaching 2mo from this comment - is the plan still to publish 3.17 in the near future? (not after a commitment, but a rough estimate will help me plan, there are a few things in 3.17 that would help with some things I'm working on). Thanks :)

  17. dbaeumer commented on Apr 22, 2022

    @dbaeumer
    Member

    Yes, still the plan. I am waiting for 2 APIs to be finalized in VS Code (which already happened in insider) and then I am good to go beginning of Mai..

  18. DanTup commented on Apr 22, 2022

    @DanTup
    ContributorAuthor

    Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunitieshover

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions