Skip to content

Eleventy Syntax Highlighter v3.0.0

Compare
Choose a tag to compare
@zachleat zachleat released this 03 Jan 02:34
· 91 commits to master since this release

By default previous versions of Eleventy attempted to wrap each individual line in <span class="highlight-line"> markup for line highlighting features. This worked in a most cases but was unreliable when tokens stretched between multiple lines (like template literals).

In v3.0, lines are only wrapped when line number arguments are passed to the highlighting plugin instance.

You can switch globally back to the old behavior using a configuration option.

eleventyConfig.addPlugin(syntaxHighlight, {
  alwaysWrapLineHighlights: true
});

Also the docs for this plugin moved to https://www.11ty.dev/docs/plugins/syntaxhighlight/