-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
text vs plaintext vs pgsql #1001
Comments
MM uses highlightJS for its highlighter, and if you don't specify any syntax, it'll try to detect the language in use (which is not bad). I'm guessing the To force plain text you can use: You can use: ```text
plain text here
``` The following all work this way:
as some platforms support combinations of those. GitHub works with nothing after the backticks using plain
and that will work both in MM and on GitHub. |
So I guess the real question here is if MM should inherit the default highlighJS behavior of auto-detection, or explicitly set no language specified to I think we could go either way on that, perhaps even with an option, but really it should probably match what GitHub does because that's the most likely target for deployment of the files. Any special fixup with At the end of the day you probably want settings that match your end usage environment. For example, on my blog I use highlightJS as well, so I would want to match the behavior. |
Since I don't publish to GitHub, the GitHub behavior is not something I depend on or would miss if it went away. I do like the idea of three backticks without a modifier defaulting to displaying as plain text. (Also, I didn't realize before this that three tildes behave like three backticks, so that's good to know.) Part of me thinks it would be ideal to ask for a MM setting that would give me the "if I don't specify anything, then please default to: " behavior, but if I'm the only one who would use it, I'd feel funny asking for it. Bottom line: I guess, stick with things the way they are, and I'll know to expect that that's how it works. At its core, my question really was just a question -- how does MM work, and why is it the way it is? -- and you've answered that for me (so, thank you!). In other words, I didn't come here asking for anything to change, and there isn't (in my mind) any bug or issue that needs to be resolved. |
Realistically you should be as precise as possible so specifying I'm considering switching the behavior to not auto-detect, because frankly it's often wrong (as you found out). Given GitHub doesn't auto-detect it would make sense to just default to Regardless I still recommend using |
I finally got curious enough about why "```text" turned into "```plaintext" between MM v1 and MM v2 when escaping blocks of text, and so I have been Googling what makes them different. I came upon this link -- github-linguist/linguist#5135 -- where the first comment asks the original poster why he's using anything after the backticks at all, since just enclosing text with three of them before and after is (he says) supposed to render the same as plain text.
That made logical sense to me, so I tried that, and I find that MM (both v1 and v2) is rendering that as "pgsql". And I had to Google that, because I didn't know what that meant -- and Google pointed me at PostgreSQL, for whatever reason. If "pgsql" is "PostgreSQL", and even if it isn't, I am surprised to find that that isn't one of the choices for Code Language when I use Alt-C or the menu bar to Insert and formatted source code snippet. In fact, I can't find a way to select "pgsql" as the code-formatting style except to avoid the Alt-C command altogether and just do three backticks (alone) myself by hand.
So I guess I have a handful of related questions:
The text was updated successfully, but these errors were encountered: