mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
docs: replace <pre> with ``` (#25136)
This commit is contained in:
@ -213,17 +213,20 @@ end
|
||||
|
||||
--- Convert vimdoc references to markdown literals
|
||||
--- Convert vimdoc codeblocks to markdown codeblocks
|
||||
---
|
||||
--- Ensure code blocks have one empty line before the start fence and after the closing fence.
|
||||
---
|
||||
--- @param x string
|
||||
--- @return string
|
||||
local function norm_text(x)
|
||||
return (
|
||||
x:gsub('|([^ ]+)|', '`%1`')
|
||||
:gsub('>lua', '\n```lua')
|
||||
:gsub('>vim', '\n```vim')
|
||||
:gsub('\n<$', '\n```')
|
||||
:gsub('\n<\n', '\n```\n')
|
||||
:gsub('%s+>\n', '\n```\n')
|
||||
:gsub('\n<%s+\n?', '\n```\n')
|
||||
:gsub('\n*>lua', '\n\n```lua')
|
||||
:gsub('\n*>vim', '\n\n```vim')
|
||||
:gsub('\n+<$', '\n```')
|
||||
:gsub('\n+<\n+', '\n```\n\n')
|
||||
:gsub('%s+>\n+', '\n```\n')
|
||||
:gsub('\n+<%s+\n?', '\n```\n')
|
||||
)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user