monaco-editor - 将 html 属性添加到生成的 span(使用 mkt.. 类)
问题描述
我正在使用该deltaDecorations
方法来装饰一些范围,您可以在其中添加特定的 css 类。但我还需要添加一些<span class="mkt...">
由编辑器生成的 html 属性(data-*)。如果可能的话,最好的方法是什么?IIdentifiedSingleEditOperation
used inexecuteEdits
方法建议替换一个或文本,IRange
但没有用于 domNode。
我会尝试 setValueInRange,希望它能解释在那里输入的 html(我可以添加一个新的标签 + 需要的属性),但是https://github.com/microsoft/monaco-editor/issues/874
解决方案
推荐阅读
- java - @CreatedBy 和 @LastModifiedBy 设置实际实体而不是 id
- jakarta-ee - 在 web.xml 中正确配置我的过滤器类
- sql - 处理m2m字段时的关系数据库设计
- python - 如何将消息转发给bale bot中的特定用户?
- typescript - 在 .on() 函数中使用来自 firebase 的数据
- rest-assured - 我得到了 405 的放心获取请求,但它在邮递员上工作正常
- java - LiveData 对象在 XML 中是否可观察?
- node.js - Synology SSO 的 Passport.js 策略
- android - 应用程序在 tabhost 中的 setContent(new Intent) 上崩溃
- google-analytics-api - 通过 API 在 Google Analytics 中读取用户权限 - 不适用于属性级别