chore: improve code
This commit is contained in:
parent
59b1d6c116
commit
07dd66ed07
2 changed files with 17 additions and 4 deletions
6
exe/yamd
6
exe/yamd
|
|
@ -110,16 +110,16 @@ class HTMLRenderer < YAMD::Renderer
|
|||
tag('a', href: to, &blk)
|
||||
end
|
||||
|
||||
def code(&blk)
|
||||
def code(lang: YAMD::Code::Lang::DEFAULT, &blk)
|
||||
tag('pre', class: "language-any") {
|
||||
tag('code', class: "language-any") {
|
||||
@buf << YAMD::Code::highlight(blk.())
|
||||
@buf << YAMD::Code::highlight(blk.(), lang)
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
def inline_code(text)
|
||||
tag('code') {
|
||||
tag('code', class: "code-inline") {
|
||||
@buf << YAMD::Code::highlight(text)
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue