chore: improve code

This commit is contained in:
kp2pml30 2026-02-08 01:24:04 +09:00
parent 59b1d6c116
commit 07dd66ed07
Signed by: kp2pml30
GPG key ID: CD6528BAC23E3E34
2 changed files with 17 additions and 4 deletions

View file

@ -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