dendron
dendron copied to clipboard
Support arbitrary numbered lists in Dendron markdown
Please select if your request is either something new or an enhancement
- [x] Enhancement of an existing Feature.
- [ ] Request of a new feature.
Please select the area your request applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)
- [ ] Workspace - VSCode workspace, vaults, Intellisense/autocomplete, Dendron settings
- [ ] Lookup - Dendron's Lookup Command
- [x] Views - Dendron Preview, Tree View, Side Panels in the UI
- [ ] Schema - Dendron Schemas
- [ ] Pod - Data import from / export to Dendron
- [x] Publish - External Site Publish
- [x] Markdown - Markdown features, such as syntax support and features
Is your feature request related to a problem? Please describe
You can't seem to start a numbered list with an arbitrary number (ex. 3, 4, 5). This renders properly in built-in Markdown preview, but not Dendron markdown. The expectation is that this should work, so may be a bug rather than a feature request.
3. I am writing stuff
4. I am writing more
The above should render as 3
and 4
, but will render as 1
and 2
instead. It seems that whenever a numbered list appears, Dendron will start the list over.
Describe the solution you'd like
It would be great if numbered lists would work as seen below, which is how GitHub renders it too:
- Here is a test
- With GFM instead
- Which works in the expected way
This will also ensure that if there are any indentation or spacing quirks going on in a Markdown file, that a user would be able to continue a numbered list and still have it render in both the preview and published result as expected.
Describe alternatives you've considered
Users already have the ability to use:
1. This list will autonumber
1. No matter how many 1 lines I use
1. Which makes it easier to re-order later
1. So users can use this if they don't want arbitrary numbers recognized
- This list will autonumber
- No matter how many 1 lines I use
- Which makes it easier to re-order later
- So users can use this if they don't want arbitrary numbers recognized
So I don't think there are alternatives other than:
- Letting users natively use arbitrary numbers where they'd like
- Continue letting users number a list with
1.
for each line if wanting auto-enumeration
Additional context
Not allowing arbitrary numbers can just cause weirdness when slight formatting or indentation changes are made in a list that cause the entire list to restart the counting unexpectedly.
Not sure how related this may be to:
- https://github.com/dendronhq/dendron/issues/2481
Agree that this is an issue.
For anyone who may look at this issue - we would need to store the list number (3
, 4
, or whatever) in the unified node during parsing, and then respect that value in the compilation.
I thought this was standard with all markdown, it seems to be that some places have taken the decision to allow this rather than it being the default base standard? https://meta.stackexchange.com/a/239121