Skip to content

Commit

Permalink
chore: trim all code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Mar 7, 2025
1 parent 4712fe3 commit de85dbb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ module.exports = function (eleventyConfig) {
html: true,
typographer: true,
quotes: '“”‘’',
highlight: (str, language) =>
hljs.highlight(str, { language: language || 'plaintext' }).value
highlight(code, language) {
const { value } = hljs.highlight(code.trim(), {
language: language || 'plaintext'
})

return value
}
})
.disable('code')
.use(markdownItAnchor, {
Expand Down

0 comments on commit de85dbb

Please sign in to comment.