-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
Respect the original Markdown syntax #363
Comments
The document you link to gives this example of a valid ordered list: 3. Bird
1. McHale
8. Parish But I think most people would agree it's silly to write like that and it's confusing for anyone reading it. So markdownlint warns about that syntax. By their nature, linters can be opinionated and will sometimes recommend against patterns that are valid. As you note, individual rules can be disabled and that's what I recommend if you find value in patterns like the above. But if you find everything too bothersome, maybe this extension isn't for you. Some people get value from it, but I understand it's not for everybody. :) |
Actually, it does not. The full quote is this (bold face is mine):
So according to "that document I linked", lists like
should not be valid. But lazy list numbering isn't really the issue here at all. The point is that Markdown is supposed to be a lightweight structured text format, that allows you to convert it to HTML or other formal structured documents. It therefore should not be more restrictive than necessary, that is why "that document I linked" explicitly allows indenting of lists, since that obviously helps readability. Also, whether I like your linting rules or not is not the issue here. The issue is that the creator of Markdown explicitly allows what your linter marks as incorrect. |
Please read the passage you wrote again - it says 3/1/8 is a valid syntax that produces the same HTML output as 1/2/3. You can verify that with Gruber's dingus here https://daringfireball.net/projects/markdown/dingus Again, markdownlint exists for people who want to impose additional restrictions on their Markdown, possibly for consistency or to avoid cross-parser problems related to the document you link being under-specified. You can read more about that here: https://commonmark.org/ There is no requirement to use this linter and I encourage you not to if it offends you. I hope it enables some people to write better Markdown, but accept that beauty is in the eye of the beholder. |
Please let us focus on the orginal issue, which is this. According to the rules of your linting marker, lists are not be be inlined. The original Markdown specification by its author John Gruber, which I cited, explicitly allows indentation of lists up to three spaces. Yes, markdownlint and your linter of course impose rules not found in the original specification. But that is not the issue. No specification is set in stone, and many do contain mistakes which should be rectified, not obeyed by. For example, the lazy numbering feature you mentioned seems worthy of discussion But you haven't given any reason why the specific rule I mentioned, and which is the object of this issue, should be disregarded. On the contrary, I can give reasons why your rule is misguided. Indenting a list
Ironically, this very list is rendered indented by GitHub's renderer, making my point. And visual appearance of Markdown source code is important, since it is not merely a format to specify visually appealing documents (like LaTeX), but which strives itself for visual clarity. It is of course your linter, but you can't just make up any rule you want: if it is to be a linter of "Markdown", then it is bound by whatever is to be understood by that term. By introducing rules contradicting that understanding you risk
I therefore kindly ask you to consider making the aforementioned rules opt-in, rather than enabling them by default, or to remove them entirely. |
You say the Gruber's syntax document says this (and only this) about the topic: "List markers typically start at the left margin, but may be indented by up to three spaces." Notably, all the examples given there start at the left margin; none are indented. And that's exactly what rule Specifically, the (unindented) sample lists from that document produce NO warnings from By default, the This approach seems entirely reasonable to me and consistent with the behavior of other linting tools. Again, if you don't agree with the defaults or the principle of this, you can customize rules, disable them, or just not use this tool. |
Gruber's definition gives explicit permission to indent lists, your rule rules that invalid. So what Gruber explicitly allows you deny: that's a contradiction. The use of the word "typically" here is explanatory rather than normative: it merely assures the reader that starting at the left margin is the common way. Indeed, if it was normative, the sentence would contradict itself. Now, it would seem that there is no difference between enforcing rules contradicting the original specification and merely enforcing stricter rules, since in both cases you end up with the same thing, namely a smaller set of allowed texts. But this view misses the point. A specification is not merely the set of all conforming instances, a specification also carries intent. It therefore does make a difference whether a linter disallows something that the spec allows as a consequence of general rules, or whether the inter disallows something that was explicitly allowed by a specific rule: in the second case you violate the spirit of the law, in the first case you don't. There also does not seem to be any good reason to disallow indenting per se; it would be enough to ban inconsistent indenting. |
I appreciate your passion here. As I stated before, markdownlint encourages people to write Markdown using a particular subset of all the possible syntax. (Much like how the CommonMark specification tries to add clarity to areas of ambiguity.) In some cases, this tool helps avoid unexpected behavior due to parser differences (ex: blank lines around lists). In some cases, it helps catch mistakes (ex: “backwards” links). In different cases, it encourages consistency and readability (ex: consecutive list item numbering). For something like list indent, the choice of how much indent to prefer is arbitrary, but was informed by common practice and is configurable. It’s clear that you don’t want any of this and I respect that. However, there are many people who use this tool regularly and I think that’s because they find value in what it does. Your feedback is heard, but I think it is more philosophical than practical. This tool is working as intended for an audience who want the kind of assistance it provides. |
I appreciate your patience and I understand that it's your project and you are under no First, I'm sorry if I have come across as not appreciating your linter at all; in fact I do.
This brings me to the second correction I need to add, namely your claim that
It would be a different matter if your linter would advertise itself as a linter of a particular I therefore kindly request that you reconsider your dismissal of my concerns as unpractical and recognize |
As it stands now, this VSCode plugin marks Markdown documents that comply with the original Markdown syntax. For example,
MD007/ul-indent
andMD004/ul-style
directly contradict the original specification, which explicitly allows one to use "*", "+" and "-" interchangeably as list markers, as well as allowing you to indent lists up to three spaces.I am aware that you can disable rules, but my point is that those rules shouldn't be there in the first place, since they are completely unnecessary and contradict the original spirit of Markdown.
The text was updated successfully, but these errors were encountered: