Add a `data-lang` attribute to code blocks #1066

Merged
merged 1 commit into from May 12, 2013

Projects

None yet

3 participants

@Rowno
Contributor
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
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-
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
Member
parkr commented May 9, 2013

👍 to consistency with lang.

@Rowno
Contributor
Rowno commented May 10, 2013

Fixed. 😀

@parkr
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 parkr merged commit 179a746 into jekyll:master May 12, 2013

1 check passed

default The Travis CI build passed
Details
@parkr parkr added a commit that referenced this pull request May 12, 2013
@parkr parkr Update history to reflect merge of #1066. 7671b45
@Rowno Rowno deleted the unknown repository branch May 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment