-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
No highlighting option? #344
Comments
Hey there, |
I guess I have to do it then 😛 . Here is the JavaScript part: see below comment Also, I was wondering where I should add the CSS part (I created three classes):
?
|
I've made some fixes and additions. |
If you need to add new tokens, you should add them to every themes |
@apfelbox Thank you. |
However, it should be noted that you should try to be conservative about the tokens you add. |
There should be no need to add other tokens. |
It’s a tradeoff. If it’s possible to use existing tokens it’s preferred, but if existing tokens are way too far from the semantic meaning of the tokens in your language, it’s better to add new ones. |
I could use the existings What's your opinion? |
@apfelbox |
@zeitgeist87 you are right, lol. 😎 |
Indeed #328 might be the solution. |
Even if I opened this issue for the Apache configuration syntax and this is solved, I still believe a Indeed:
As Prism doesn't format |
language-none is a hack, it shouldn’t needed. If it is, that’s a bug with Prism. |
For those finding this later -- Prism now formats |
@brandones as per v1.16 having Is it intended or did I misinterpreted your last comment? |
@jfcere I think Prism used to not work when the specified language was unknown to Prism. |
@RunDevelopment thanks for your follow up. Is this something you guys would be willing to do? I could do the PR if you guys agree. Although I could be wrong, I think it is pretty much expected that Anyhow, I'll respect your decision and will find my way around this if the proposition is rejected. |
The underlying issue is most themes do something like this to style This also would technically be a breaking change, as we're now styling things we weren't before, and would require consumers to overwrite our styles if they didn't want them. |
@jfcere I think that this would create the problem that you can't opt out anymore. Right now, Prism is strictly opt-in meaning that only the code blocks you give a special I don't know if this is worth the hassle, plus it would be a breaking change as @mAAdhaTTah pointed out while I wrote this. Also, Prism supports the inheritance of |
Alright, I understand and it makes a lot of sense. My situation is different because I am using Prism inside Angular framework which only applies Prism on specified elements instead of the whole page making the concern of not wanting the code to be highlighted for a certain element irrelevant in that context (you can look my repository ngx-markdown if you are curious). Thanks again for your follow up and this awesome library! |
In that case, I assume that it is not possible to call the It will behave a little strangely, but it should work. (If I read the code correctly, you'll get nice little On that note: Maybe we should make it so that |
You could wire a customer renderer to change inline code blocks to have the expected class. |
FWIW, I agree with the others about not targeting class-less
Yeah, that sounds like a nice little fix, so that code listings with no language can be styled with one class. I wonder if there's any value in distinguishing the two cases though. |
I don't think there is. |
`chef-snippet` will throw an error if the syntax grammar rules for the language are unavailable. Instead, this commit modifies the code highlighter to fallback to rendering code blocks as uncolored plain text in this scenario. PrismJS/prism#344 (comment) Fixes #3462 Signed-off-by: Scott Christopherson <[email protected]>
`chef-snippet` will throw an error if the syntax grammar rules for the language are unavailable. Instead, this commit modifies the code highlighter to fallback to rendering code blocks as uncolored plain text in this scenario. PrismJS/prism#344 (comment) Fixes #3462 Signed-off-by: Scott Christopherson <[email protected]>
`chef-snippet` will throw an error if the syntax grammar rules for the language are unavailable. Instead, this commit modifies the code highlighter to fallback to rendering code blocks as uncolored plain text in this scenario. PrismJS/prism#344 (comment) Fixes #3462 Signed-off-by: Scott Christopherson <[email protected]>
I'd like to create a code block with some Apache configuration, however, there is no such language definition for Prism at the moment.
I'd be happy with just a code block with plain black text and no syntax highlighting but I couldn't find a way to do that.
The text was updated successfully, but these errors were encountered: