-
-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Description
When a user adds a class attribute value to preAttributes or codeAttributes, nothing happens:
eleventyConfig.addPlugin(pluginSyntaxHighlight, {
preAttributes: {
class: "hey-this-is-a-custom-class-name",
},
codeAttributes: "this-is-also-custom-class-name",
});Resulting DOM:
I assume this is because <pre> and <code> already have a class name that denotes the language being used (e.g. language-js).
Possible solutions
- Maybe we can concatenate the new class names to the existing one, taking care not to overwrite the originals
- ...or add the possibility for the user to add a wrapper element over the
<pre>, because the scenario (at least in my case) is to add some layout styling to the code block (say,max-width):
eleventyConfig.addPlugin(pluginSyntaxHighlight, {
wrapper: {
element: "div",
attributes: {
// here be attributes
}
},
});pechorin and WickyNilliams
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
