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

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 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- 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 parkr commented May 9, 2013

👍 to consistency with lang.

@Rowno
Copy link
Contributor Author

@Rowno Rowno commented May 10, 2013

Fixed. 😀

@parkr
Copy link
Member

@parkr 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
1 check passed
1 check passed
default The Travis CI build passed
Details
parkr added a commit that referenced this pull request May 12, 2013
@Rowno Rowno deleted the Rowno:data-language branch May 12, 2013
@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
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.