Releases: 11ty/eleventy-plugin-syntaxhighlight
Eleventy Syntax Highlighter v5.0.0
- Breaking: we no longer throw an error when you pass in an invalid language. Use
errorOnInvalidLanguage: true
to re-enable errors by default. #70 #73 - Breaking: changes default
lineSeparator
option from"<br>"
to"\n"
#82 This fixes an issue with missing line breaks in some feed readers! - Fixed: Markdown syntax highlighter generated invalid HTML in some cases #80 Thank you @marvinhagemeister!
- Bug fixes for
diff-
syntax #75 #76 - Removes undocumented character wrapping feature #81
Plugin documentation: https://www.11ty.dev/docs/plugins/syntaxhighlight/
Milestone: https://github.com/11ty/eleventy-plugin-syntaxhighlight/milestone/14?closed=1
Full Changelog: v4.2.0...v5.0.0
Contributors
Eleventy Syntax Highlighter v4.2.0
- Updates from
prismjs
1.26.0 to 1.29.0 - Adds
syntax-highlight.webc
WebC syntax highlighter component, in-use on https://github.com/11ty/demo-webc-image-compare/blob/358777337366dd2426c064c7bf2b200f10df98a5/index.webc (example usage) - Adds GitHub actions to run the test suite.
Full Changelog: v4.1.0...v4.2.0
Eleventy Syntax Highlighter v4.1.0
What's Changed
preAttributes
andcodeAttributes
options can be callback functions by @chriskirknielsen in #50 #52- Fix Extra blank lines in highlighted output @rmcginty in #59 #60
- Demo style improvements #64
- Add
nunjucks
andnjk
languages, aliased tojinja2
#68.
New Contributors
- @chriskirknielsen made their first contribution in #50
- @rmcginty made their first contribution in #60
Full Changelog: v4.0.0...v4.1.0
Eleventy Syntax Highlighter v4.0.0
Adds new highlight
JavaScript function, for use in 11ty.js
templates.
Docs: https://www.11ty.dev/docs/plugins/syntaxhighlight/#javascript-function-(for-11ty.js)
e.g. sample.11ty.js
:
module.exports = function(data) {
let result = this.highlight("js", "var test;");
return result;
};
Eleventy Syntax Highlighter v3.2.2
- Bundles the Prism
diff-highlight
plugin, allowing the use ofdiff-
languages and+
and-
prefixes on lines.- Works as expected with language aliases.
- Enables Prism silent mode to avoid "Language does not exist" console.logs.
v3.1.1
Improves accessibility friendliness of HTML with the addition of preAttributes
and codeAttributes
to options for global attribute additions to the rendered HTML. Pass in an object literal! Thank you @ChrisBrownie55 for #48.
Read more at: https://accessibilityinsights.io/info-examples/web/scrollable-region-focusable/
Milestone: https://github.com/11ty/eleventy-plugin-syntaxhighlight/milestone/9?closed=1
Eleventy Syntax Highlighter v3.0.1
Issues Resolved
Links
⭐️ Support Eleventy by starring us on GitHub! This will increase our project’s visibility on staticgen.com, a big giant list of static site generators.
🐦 Follow us on Twitter @eleven_ty!
Eleventy Syntax Highlighter v3.0.0
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/
Eleventy Syntax Highlighter v2.0.2
Eleventy is a simpler Static Site Generator! This is a Prism.js syntax highlighter plugin for Eleventy!
Changelog
Milestone
Dependency Semver Major Version Updates
- None
Links
⭐️ Support Eleventy by starring us on GitHub! This will increase our project’s visibility on staticgen.com, a big giant list of static site generators.
🐦 Follow us on Twitter @eleven_ty!
eleventy-plugin-syntaxhighlight v2.0.0
Eleventy is a simpler Static Site Generator! This is a Prism.js syntax highlighter plugin for Eleventy!
Major Version Breaking Changes
- Moves from using
<div class="highlight">
(display: block
styling) to using semantic HTML elementsins
,del
, andmark
(which aredisplay: inline
elements) which have default browser styling associated with them. Check out the default line highlighting CSS sample in the README. Issues: #6, #7. Thanks @mathiasbynens for this update!
Changelog
- Adds a Nunjucks syntax highlighter shortcode
{% highlight "js" %}
- Use only some of the plugin pack (#2)
- Customize Prism with the direct access to the Prism instance in the
options.init
callback (#4) - Bug fix: empty new lines were not rendering correctly (#5) Thanks @mathiasbynens!
Milestone
Dependency Semver Major Version Updates
- None
Links
⭐️ Support Eleventy by starring us on GitHub! This will increase our project’s visibility on staticgen.com, a big giant list of static site generators.
🐦 Follow us on Twitter @eleven_ty!