branch: elpa/typst-ts-mode commit 272ecc1db7acad9bd9de15e01bdd14cd2c4d6119 Author: meowking <mr.meowk...@tutamail.com> Commit: meowking <mr.meowk...@tutamail.com>
fix: font lock highlight order closes: https://codeberg.org/meow_king/typst-ts-mode/issues/19 --- typst-ts-mode.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/typst-ts-mode.el b/typst-ts-mode.el index ddbe36264d..5143cd77d4 100644 --- a/typst-ts-mode.el +++ b/typst-ts-mode.el @@ -272,6 +272,14 @@ If you want to customize the rules, please customize the same name variable typst-ts-mode-font-lock-rules-comment '((comment) @font-lock-comment-face)) + ;; `ref' should be placed before `shorthand' to render properly + ;; e.g. @CitationKey[p.~7] + :language typst + :feature markup-basic + ,(if typst-ts-mode-font-lock-rules-markup-basic + typst-ts-mode-font-lock-rules-markup-basic + markup-basic) + :language typst :feature common ,(if typst-ts-mode-font-lock-rules-common @@ -279,12 +287,6 @@ If you want to customize the rules, please customize the same name variable '((shorthand) @typst-ts-shorthand-face (ERROR) @typst-ts-error-face)) - :language typst - :feature markup-basic - ,(if typst-ts-mode-font-lock-rules-markup-basic - typst-ts-mode-font-lock-rules-markup-basic - markup-basic) - :language typst :feature markup-standard ,(if typst-ts-mode-font-lock-rules-markup-standard