-
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
language-markdown uses "important" class #1090
Comments
I'd argue that titles are indeed important. That seems quite semantic to me. There are many classes we use that are likely to already have styles: If your own styles do not play well with Prism's ones, then you might just need to write a bit of CSS to fix this. |
By that argument, everything is important. What, is the text less important than the titles? In fact if you study law you'll learn that the titles of statutes and contracts are usually less important than the text, as they are given for simple organization purposes and do not provide any additional normative weight to the text. Learn more about this reading about the "Headings clause". The purpose of the Prism markup is to show syntax highlighting for the various formats. So maybe I should better state my case by saying that if the style is going to be so general, it should be a noun, not an adjective. Let's not make this complicated: Prism found a Markdown heading. So it should give it a style of "heading". Whether the heading/title is "important" or not is not for Prism to decide; that's an opinionated judgment call. Just mark it as a Markdown heading, which is what it is, and we'll all be happy. If I have CSS code using "heading" or "title", then I'll modify it so that it doesn't apply to Prism. But my beef is that Prism has no business trying to tell me what is "important" or not. Just my opinion---but I think my reasoning here not too far off. |
And I'm pretty sure @LeaVerou will agree with you. The |
@garretwilson The problem is that we need to reuse token names across languages, otherwise every theme would need to be updated for every language, which as you can imagine, does not scale. It's indeed a tough problem, if you have any ideas, please post them in #1055. However, complaining about the current state of things without proposing an alternative is not very productive for any of us. |
@LeaVerou I wasn't aware of the wider problem. I was just making you aware of the immediate problem, which had been addressed in #1044 for another language. If there is a wider problem, sure I'll look into it and see if I have any ideas. But in for the immediate issue, are you saying that you addressed it for |
For you to understand better why this is such a problem, and why I cannot just set up my stylesheet selectors to ignore things inside <pre><code class="language-java">final Vehicle vehicle = new Airplane();
vehicle.move(); //<span class="important">invoked Airplane.move()</span></code></pre> Note that I have my own style for You're right that it is only coincidental that there is a semantic mismatch here; it is possible in other cases that Prism might use a style with the correct semantics related to a code block, yet it would incorrectly bring in a style I had of the same name. So I acknowledge that there is a bigger issue here: namely, of style name clashes. But name clashes is by no means a new issue in computing. Why not simply prefix all Prism styles with some sort of "namespace" prefix, e.g. "prism-"? But suggestions for resolving name clashing I'll post on #1055. For this present issue, I reiterate that "important" is not semantically correct in the first place, and if we change it as was done in #1044 this will buy us time for addressing #1055. Do you see where I'm coming from, and what do you think? |
Another issue is that, to be semantically correct in all languages, Prism would have to use a huuuge number of different classes, which do not currently exist in the themes stylesheets. The |
The recent issue #1119 made me think that you might want to use this plugin to solve your problem. I'll close this issue, though, since there is no obvious way to solve it in the near future. |
@Golmote I was overjoyed to see that plugin, but then I saw that I will need to go back and modify all of my documents, adding a new code segment with custom JavaScript to all my pages! Is there no way someone could provide a version of this plugin with a default prefix, so that Prism simply automatically uses a It is a lot of overhead to not only force my authors to add extra JavaScript to all pages --- not only for future documents, but for all past document! (If there were an option to include this in Prism, we could easily update it across the board by simply updating the shared CSS/JS file.) |
I can't try it yet, because the download mechanism seems to be broken; see #1136 . |
Arg, this is biting me again. Just like in #1044, the
language-markdown
plugin seems to be using a class ofimportant
to style sections of code. So if I have:## FooBar
It gets rendered:
As discussed in #1044, the style "important" is not semantically reflective of the particular thing being styled. Plus because the word
important
is so general, it's likely to already have a style (for another purpose). So now I get big exclamation marks in the middle of my Markdown.@aviaryan, maybe this is something you can address like you did in #1047 ?
The text was updated successfully, but these errors were encountered: