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 a data-lang attribute to code blocks #1066

Merged
merged 1 commit into from May 12, 2013
Merged

Add a data-lang attribute to code blocks #1066

merged 1 commit into from May 12, 2013

Conversation

Rowno
Copy link
Contributor

@Rowno Rowno commented May 9, 2013

Allows a language label to be added to code blocks using a CSS pseudo-element. It would also make it easier to retrieve the language using Javascript, rather than having to parse the classes.

Example:

code:before {
    content: attr(data-lang);
}

@parkr
Copy link
Member

parkr commented May 9, 2013

Can you please fix the tests to include the new data attribute?

Also, data-lang vs data-language? What do you think?

@mattr-
Copy link
Member

mattr- commented May 9, 2013

lang is used in other places, such as <html lang='en'>, so I think I prefer data-lang for consistency with that.

@parkr
Copy link
Member

parkr commented May 9, 2013

👍 to consistency with lang.

@Rowno
Copy link
Contributor Author

Rowno commented May 10, 2013

Fixed. 😀

@parkr
Copy link
Member

parkr commented May 11, 2013

@benbalter Will bring this in tomorrow as well, which might break your tests again. Just a head's up :)

parkr added a commit that referenced this pull request May 12, 2013
Add a `data-lang` attribute to code blocks
@parkr parkr merged commit 179a746 into jekyll:master May 12, 2013
parkr added a commit that referenced this pull request May 12, 2013
@Rowno Rowno deleted the data-language branch May 12, 2013 20:06
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants