Use newer `language-` class name prefix #1037

Merged
merged 1 commit into from May 7, 2013

Projects

None yet

5 participants

@djui
Contributor
djui commented May 6, 2013

This change makes it partly possible to use Jekyll+RedCarpet+Prism.js without using a plugin.

Another change will respect Jekyll's pygments configuration option and not render the code block using Pygments. Together, these two changes allow using prism.js with Jekyll out of the box.

@djui djui Use newer `language-` class name prefix
This change makes it partly possible to use Jekyll+RedCarpet+Prism.js without using a plugin.

Another change will respect Jekyll's `pygments` configuration option and not render the code block using Pygments. Together, these two changes allow using prism.js with Jekyll out of the box.
3770bcb
@mattr-
Member
mattr- commented May 7, 2013

I don't see a problem with this. 👍 from me.

@caspervonb

Neat, was looking to patch this in today myself.

@parkr
Member
parkr commented May 7, 2013

This is only one change. Where's the other?

My biggest concern is that this breaks all the CSS styles people have written for custom code highlighting :/ No backwards-compatibility, unless you set class="lang language-lang".

@djui
Contributor
djui commented May 7, 2013

The other one is in a separate pull-request ( #1038 ) because they can be seen separate.

I agree with the backwards-compatibility point. Using both class names would be a sufficient solution.

@parkr
Member
parkr commented May 7, 2013

Great! Keep it backwards-compatible, fix the tests and we're good to go.

@parkr parkr merged commit 6b9ef70 into jekyll:master May 7, 2013

1 check failed

default The Travis build failed
Details
@parkr parkr added a commit that referenced this pull request May 7, 2013
@parkr parkr Update tests to be compliant with #1037. 5dd3b0b
@parkr parkr added a commit that referenced this pull request May 7, 2013
@parkr parkr Update history to reflect merge of #1037. 81fea5a
@Rowno
Contributor
Rowno commented May 8, 2013

Any chance you can add a something like a data-lang attribute? I was adding language labels to my code block using the CSS below, but this change breaks it. 😢

code:before {
    content: attr(class);
}
@parkr
Member
parkr commented May 8, 2013

The diff here doesn't reflect the changes entirely. We now use class="<lang> language-<lang>" when writing codeblocks, thus merely adding language-<lang> to the list. Nothing we changed could have ruined the code you have already written, as far as I can tell! :)

@Rowno
Contributor
Rowno commented May 8, 2013

It ruined it because now I get css language-css etc in my labels (instead of just css), which is why I suggested adding a data-lang attribute.

@parkr
Member
parkr commented May 9, 2013

Gah, sorry, I didn't even really process the code. Late-night brain mode :) I am weary about adding more attributes :/

@Rowno
Contributor
Rowno commented May 9, 2013

Oh well, it was nice while it lasted. 😞

@parkr
Member
parkr commented May 9, 2013

Tell you what: submit a PR and we'll talk it over with @mattr-. I may be weary, but I'm not opposed. :)

@Rowno
Contributor
Rowno commented May 9, 2013

Done #1066

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment