Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getAttributes to allow for custom attributes #10

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

dancormier
Copy link
Contributor

@dancormier dancormier commented Mar 22, 2022

Lifted from https://github.com/11ty/eleventy-plugin-syntaxhighlight/blob/master/src/getAttributes.js and associated.

The what: This PR will allow us to add arbitrary attributes to the <pre> and <code> elements.

The why: While working on StackExchange/Stacks#829, I realized I couldn't add a data- attribute to the <code> element in the Stacks docs. I'm not positive I'll need it for StackExchange/Stacks#829, but I went through the trouble, so here we are.

P.S. I could've also sworn I saw an issue requesting a tabindex be added to <code> or <pre> elements for some reason, but I can't seem to find it. Nevertheless, this PR would enable that too.

@b-kelly b-kelly merged commit 00c8d2c into b-kelly:master Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants