nilmarko48 downloadsHighlight text with regex and apply custom CSS classes.
中文 | English
#Regex-CSS-Highlighter-en
An Obsidian plugin that matches text via regular expressions and applies custom CSS styles for highlighting.


.gif)
.gif)




Search for "Regex Css Highlighter" in Obsidian Settings → Community Plugins → Browse to install directly.
main.js and manifest.jsonRegex-Css-Highlighter folder in your Obsidian vault's .obsidian/plugins/ directory\\.) could not be matched when removing highlights by selecting text; replaced direct string comparison with regex matching via textMatchesRegex() helper functionapplyHighlightsToLivePreviewCallouts method to apply DOM-based highlighting to callout widgets in live preview mode; ViewPlugin's update now schedules callout highlight via debounced requestAnimationFrame; scroll and layout-change events also trigger callout highlighting in source modeto key; added validation filter for invalid ranges; switched to Decoration.set(validRanges, true) to enable CodeMirror's internal sorting for safer handling of overlapping decorations from multiple rulesaddremark.gif to assets folder and referenced it in both English and Chinese Notes/备注功能 sections of README.md中文 | English
#Regex-CSS-Highlighter-zh
一个 Obsidian 插件,通过正则表达式匹配文本并应用自定义 CSS 样式高亮显示。


.gif)
.gif)




在 Obsidian 设置 → 社区插件 → 浏览 中搜索 "Regex Css Highlighter" 直接安装。
main.js、manifest.json.obsidian/plugins/ 目录下创建 Regex-Css-Highlighter 文件夹\\.)的规则无法通过选中文本移除高亮的问题,改用 textMatchesRegex() 辅助函数进行正则匹配applyHighlightsToLivePreviewCallouts 方法,对实时预览中的callout组件应用DOM高亮;ViewPlugin更新时通过防抖 requestAnimationFrame 调度callout高亮;滚动和布局变化事件也会触发callout高亮to 作为次要排序键;添加无效范围过滤;使用 Decoration.set(validRanges, true) 启用CodeMirror内部排序,更安全地处理多规则重叠装饰addremark.gif,并在README中英文备注功能部分引用