Using markdown in IMarkerData

Viewed 211

I am trying to implement diagnostics to my language-service. According to the following question I got that I can't use html to customize my messages but I can use markdown syntax.

Can markers support html display just like hoverProvider do?

However when I try to use markdown syntax for markers I got the message as it is.

 monaco.editor.setModelMarkers(model, this._selector, markers);
 // "# Big Title \\n Please google it   [Google](https://www.google.com) " as a message 

I got the string as it is.

enter image description here

1 Answers

You can use the code property of the IMarkerData object.

{
  ...
  code: {
    target: 'https://www.google.com',
    value: 'Google'
  }
} 

This will add the link with the text Google like this

enter image description here

Related