Compare commits

...

2 Commits

Author SHA1 Message Date
TEC e61d01d6ea
Add url markup construct 2022-10-16 16:02:09 +08:00
TEC 0afcccadc8
Supporty markup :body patterns 2022-10-16 16:01:45 +08:00
1 changed files with 8 additions and 4 deletions

View File

@ -40,6 +40,9 @@
(:start "`" :end "`" :face font-lock-doc-markup-face))
(markdown-code
(:start "`" :end "`" :face font-lock-doc-markup-face))
(url
(:start "<" :body "https?:\\([^>\n]*\\(?:\n[ \t]*[^> \t\n][^>\n]*\\)*\\)"
:end ">" :face link))
(latex
(:start "\\(" :end "\\)" :face font-lock-string-face))
(tex
@ -55,7 +58,7 @@
(const :function))
:value-type sexp)))
(defcustom simple-comment-markup-set 'org
(defcustom simple-comment-markup-set '(org url)
"docstring"
:type '(choice symbol (repeat symbol)))
@ -110,11 +113,12 @@ This must not include any capturing groups."
(length (plist-get pattern :start)))))
patterns)))
(body-rx
(rx-to-string
`(seq (not (any space ,@confounding-start-characters))
(or (plist-get pat :body)
(rx-to-string
`(seq (not (any space ,@confounding-start-characters))
(optional
(*? not-newline)
(not space))))))
(not space)))))))
`((,(rx (regexp simple-comment-markup-pre-rx)
(group (literal (plist-get pattern :start)))
(group (regexp body-rx))