feat(markdown): conceal triple backticks and HTML entities

This commit is contained in:
Maria José Solano 2023-09-17 14:13:50 -07:00 committed by Christian Clason
parent 9dd3e07609
commit eb0f975bf2
2 changed files with 16 additions and 0 deletions

View file

@ -26,6 +26,14 @@
(fenced_code_block_delimiter)
] @punctuation.delimiter
;; Conceal backticks
(fenced_code_block
(fenced_code_block_delimiter) @conceal
(#set! conceal ""))
(fenced_code_block
(info_string (language) @conceal
(#set! conceal "")))
(code_fence_content) @none
[

View file

@ -92,3 +92,11 @@
"]"
] @conceal
(#set! conceal ""))
;; Replace common HTML entities.
((entity_reference) @conceal (#eq? @conceal " ") (#set! conceal ""))
((entity_reference) @conceal (#eq? @conceal "&lt;") (#set! conceal "<"))
((entity_reference) @conceal (#eq? @conceal "&gt;") (#set! conceal ">"))
((entity_reference) @conceal (#eq? @conceal "&amp;") (#set! conceal "&"))
((entity_reference) @conceal (#eq? @conceal "&quot;") (#set! conceal "\""))
((entity_reference) @conceal (#any-of? @conceal "&ensp;" "&emsp;") (#set! conceal " "))