Skip to main content

Wrap output with custom HTML

const html = await highlight(
'const x = 1',
htmlInline({
language: javascript,
theme: dracula,
header: {openTag: '<figure><figcaption>index.js</figcaption>', closeTag: '</figure>'},
})
)

See Build a code block header with copy button for a fuller pattern.