Skip to content

Commit dc94def

Browse files
committed
chore(asciidoc): Literal blocks
1 parent f245285 commit dc94def

3 files changed

Lines changed: 420 additions & 0 deletions

File tree

lua/markview/parsers/asciidoc.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ asciidoc.insert = function (data)
2424
table.insert(asciidoc.sorted[data.class], data);
2525
end
2626

27+
---@param buffer integer
28+
---@param TSNode TSNode
29+
---@param text string[]
30+
---@param range markview.parsed.range
31+
asciidoc.code_block = function (buffer, TSNode, text, range)
32+
asciidoc.insert({
33+
class = "asciidoc_code_block",
34+
35+
text = text,
36+
range = range
37+
});
38+
end
39+
2740
---@param buffer integer
2841
---@param TSNode TSNode
2942
---@param text string[]
@@ -351,6 +364,8 @@ asciidoc.parse = function (buffer, TSTree, from, to)
351364
(block_macro_name) @kbd_keyword
352365
(#eq? @kbd_keyword "kbd")
353366
)) @asciidoc.keycode
367+
368+
(literal_block) @asciidoc.code_block
354369
]]);
355370

356371
if not can_scan then

0 commit comments

Comments
 (0)