mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 15:51:32 +00:00
feat(help): highlighted codeblocks
This commit is contained in:
@@ -489,7 +489,7 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
|
||||
end
|
||||
return string.format('<div class="help-para">\n%s\n</div>\n', text)
|
||||
elseif node_name == 'line' then
|
||||
if parent ~= 'codeblock' and (is_blank(text) or is_noise(text, stats.noise_lines)) then
|
||||
if parent ~= 'code' and (is_blank(text) or is_noise(text, stats.noise_lines)) then
|
||||
return '' -- Discard common "noise" lines.
|
||||
end
|
||||
-- XXX: Avoid newlines (too much whitespace) after block elements in old (preformatted) layout.
|
||||
@@ -535,7 +535,12 @@ local function visit_node(root, level, lang_tree, headings, opt, stats)
|
||||
return s
|
||||
elseif node_name == 'argument' then
|
||||
return ('%s<code>{%s}</code>'):format(ws(), text)
|
||||
-- TODO: use language for proper syntax highlighted code blocks
|
||||
elseif node_name == 'codeblock' then
|
||||
return text
|
||||
elseif node_name == 'language' then
|
||||
return ''
|
||||
elseif node_name == 'code' then
|
||||
if is_blank(text) then
|
||||
return ''
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user