3 ms·
Sure. I wasn't counting HTML's ol tag, that's not fair :) 1. Nissan 2. Tesla 3. BYD To (god forbid!) remove Tesla, you have to write 1. Nissan 2. BYD Now g
by fxfan 7y ago
Sure.
I wasn't counting HTML's ol tag, that's not fair :)
1. Nissan
2. Tesla
3. BYD
To (god forbid!) remove Tesla, you have to write
1. Nissan
2. BYD
Now generate a diff:
-- 2. Tesla --
-- 3. BYD --
++ 2. BYD --
Ideally the diff should be:
-- <some marker> Tesla --
- chrishannah 7y agoAlthough I would argue it looks better, you don't have to use sequential numbers when defining ordered lists. Taken from the Markdown Syntax Documentation (https://daringfireball.net/projects/markdown/syntax https://daringfireball.net/projects/markdown/syntax): It’s important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces. The HTML Markdown produces from the above list is: <ol> <li>Bird</li> <li>McHale</li> <li>Parish</li> </ol> If you instead wrote the list in Markdown like this: 1. Bird 1. McHale 1. Parish ... you’d get the exact same HTML output. The point is, if you want to, you can use ordinal numbers in your ordered Markdown lists, so that the numbers in your source match the numbers in your published HTML. But if you want to be lazy, you don’t have to.
- enriquto 7y agoNotice that in HTML5 you do not need to close the li tags
- intertextuality 7y agoAlthough not exactly aesthetically pleasing, I actually prefer the 1. 1. 1. layout. Why? Because when you write something it's common to revise and re-order things. A lot. Having 1. 2. 3. means I'd have to go and fix the rest of the list. I see 1. 1. 1. like appending commas to every field in a struct declaration or an object constructor. It allows me to go back and arbitrarily move things around.
- zimpenfish 7y agoYou can use "1." for all items in a numbered list. https://i.imgur.com/VEYqLWE.png https://i.imgur.com/VEYqLWE.png rjp$ diff -u test.md test-notesla.md --- test.md 2019-04-25 10:58:23.000000000 +0100 +++ test-notesla.md 2019-04-25 10:59:03.000000000 +0100 @@ -1,4 +1,3 @@ 1. Nissan -1. Tesla 1. BYD
- masklinn 7y ago> To (god forbid!) remove Tesla, you have to write You don't actually have to do that, markdown will convert numbered lists to an HTML ordered list, the numbers are just numbered list markers and otherwise ignored: https://hackmd.io/EVPo3hJpQBenp08uy4ZEuA https://hackmd.io/EVPo3hJpQBenp08uy4ZEuA This behaviour is usually annoying. reStructuredText supports "#" as a numbered list sigil (as well as various numeral styles e.g. roman or alphabetic). It also supports a custom start, however if the list is explicitly numbered it does not support "holes" e.g. 3 4 5 is fine (and will keep this numbering in the output), 2 3 5 is not.