简体   繁体   English

在 IMarkerData 中使用 markdown

[英]Using markdown in IMarkerData

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.根据以下问题,我得到我不能使用 html 来自定义我的消息,但我可以使用 markdown 语法。

Can markers support html display just like hoverProvider do?标记能否像 hoverProvider 一样支持 html 显示?

However when I try to use markdown syntax for markers I got the message as it is.但是,当我尝试对标记使用 markdown 语法时,我得到了消息。

 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.我得到了字符串。

在此处输入图像描述

You can use the code property of the IMarkerData object.您可以使用IMarkerData object 的code属性。

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

This will add the link with the text Google like this这将像这样添加带有文本Google的链接

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在摩纳哥编辑器中获得Markdown预览? - How to get Markdown preview in the Monaco Editor? 我如何获得建议 (registerCompletionItemProvider) 在摩纳哥的 Markdown 的大括号之间显示? - How can I get suggestions (registerCompletionItemProvider) to show between curly braces in for Markdown in Monaco? 如何将 javascript 自动完成添加到摩纳哥编辑器的 markdown 模式? - How do I add javascript autocomplete to markdown mode of monaco editor? 如何使嵌套的 markdown 项目符号列表在 vscode 中具有不同的项目符号 styles - How to make nested markdown bullet lists have different bullet styles in vscode 在 Monaco Editor 中使用热键? - Using Hot Keys with Monaco Editor? 使用require js导入monaco编辑器 - Import monaco editor using require js 使用 getWordUnderCursor 获取包含撇号的单词? - Using getWordUnderCursor to get words that contain apostrophes? 如何使用 Javascript 删除 Monaco Editor 的自动完成功能? - How to remove autocompletions for Monaco Editor using Javascript? 使用带有 React 和 Webpacker 的 Monaco Editor 的 regeneratorRuntime 错误 - regeneratorRuntime error using Monaco Editor with React and Webpacker 使用 esbuild 捆绑时出现意外使用 - Unexpected usage when bundled using esbuild
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM