我正在为 Prism.js 编写自定义语言扩展,但在突出显示注释时遇到问题。我想突出显示以#or//开头并从行首开始的注释:
# Example comment
// Example comment
1*2//comment <-- this should not be highlighted
这是我用来检测评论的模式/(^|[^\\])[#\/\/].*/:
不幸的是,它没有按预期工作:
我尝试使用lookbehindandgreedy选项(docs),但没有帮助。
