Monaco-editor: HTML support in hover (inline HTML in IMarkdownString)

Created on 5 Apr 2018  路  5Comments  路  Source: microsoft/monaco-editor


monaco-editor version: latest
Browser:chrome
OS: win10
Steps or JS usage snippet reproducing the issue:
I want my completion item documentation or hover documentation have inline html.
For example, signature should be colorized, such as:
image

Here is what I've tried:
image
As the above image shows, the inline html is santinized,.

editor-hover feature-request

Most helpful comment

@mofux That's a bug with monaco-css. I've opened #805 as that's a different problem.

All 5 comments

@ryanlin1986 I also opened a separate #802 to describe the problem where the hover behaviour doesn't match VS Code's.

Not sure if it's related, but this feature seems to be broken in general since 0.11.x. One good example is if you go to https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-rendering-glyphs-in-the-margin, switch to the CSS tab and hover over one of the rules. The content of the tooltip used to be colorised in previous versions, now it's printed as plain text with strange tick marks around them:

screen shot 2018-04-06 at 01 04 53

This might be related to the changes noted in #780, not sure.

@rcjsuen thanks for the help;)

@mofux That's a bug with monaco-css. I've opened #805 as that's a different problem.

@ryanlin1986 do you happen to have that code example which you used in describing the issue? I have a problem displaying the hover message, as it cannot find IMarkdownString for some reason, although it's clearly exported.

Was this page helpful?
0 / 5 - 0 ratings