Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This came up in #2665:
Right now, we use
language-none
(or justnone
) to mean "no language" but that has actually two meanings. "No language" could mean either plaintext or that the language is undefined/unknown. These two distinct concepts are both represented bynone
.This is a problem when language detection comes into play. A code block with no (defined) language will get language
none
by default, so the language detector can do its job. But what happens for a plaintext code block? The user will use thelanguage-none
class to indicate plaintext. But these two cases are indistinguishable from the perspective of the language detector.The simple solution for this problem is to split
none
into two languages:none
andplain
.From now on,
none
only represents an undefined/unknown language andplain
will represent plaintext.This solves the problem has some additional advantages as well. Since
none
has no grammar, plugins like Show Invisibles cannot be used.plain
will have an empty grammar, so plugins like SI will work.I'm also thinking about giving
plain
some aliases likeplaintext
,plain-text
,text
, andtxt
but this will make the implementation less simple.