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

Plugin overrides own classes for pre #7

Open
philippwiddra opened this issue Dec 11, 2013 · 3 comments
Open

Plugin overrides own classes for pre #7

philippwiddra opened this issue Dec 11, 2013 · 3 comments

Comments

@philippwiddra
Copy link

It appears to me that the plugin overrides other classes of the pre tag when generating.

Especially when using the bootstrap class .pre-scrollable it is a little annoying that all original classes are stripped off the <pre> tag.
Im not sure if this also applies to classes of the original <code> tag.

Example:

<pre class="pre-scrollable">
    <code class="lang-json">
{
    "foo": 1
}
    </code>
</pre>

Should generate into:

<pre class="pre-scrollable highlight">
    <code class="json">
{
    "<span class="attribute">foo</span>": <span class="value"><span class="number">1</span></span>
}
    </code>
</pre>

But instead generates into:

<pre class="highlight">
    <code class="json">
{
    "<span class="attribute">foo</span>": <span class="value"><span class="number">1</span></span>
}
    </code>
</pre>

If this is the intended behavior i apologize for bothering you, but if not it may be important for more people than me.

@jacoscaz
Copy link

jacoscaz commented Feb 6, 2014

Same here. This also breaks support for some of the .css themes as they look for '.hljs'-classed <pre> tags.

EDIT: I'll elaborate a bit more. I have just updated all the plugins for a docpad-generated website and docpad-plugin-highlightjs' update broke support for Highlight.js' solarized_dark (but also solarized_light) themes, even for their latest versions. This seems to be due to the <pre> tag missing the .hljs (which, I presume, used to be there in previous versions).

Adding the aforementioned class via dev console gets things back to normal.

@balupton
Copy link
Member

balupton commented Feb 6, 2014

If someone can submit a pull request for this, that would be amazing.

@jacoscaz
Copy link

jacoscaz commented Feb 7, 2014

I'll have a look into it over the weekend. There seem to be two different
issues at play: one is the default class being set to 'highlightjs' instead
of 'hljs', which seems to be easily fixable, and the other is classes being
overridden instead of appended to. I'll let you know asap.
On Feb 7, 2014 12:29 AM, "Benjamin Arthur Lupton" [email protected]
wrote:

If someone can submit a pull request for this, that would be amazing.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-34387163
.

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

No branches or pull requests

3 participants