dendron icon indicating copy to clipboard operation
dendron copied to clipboard

Support arbitrary numbered lists in Dendron markdown

Open ScriptAutomate opened this issue 2 years ago • 2 comments

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:

  1. Here is a test
  2. With GFM instead
  3. 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
  1. This list will autonumber
  2. No matter how many 1 lines I use
  3. Which makes it easier to re-order later
  4. 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

ScriptAutomate avatar Sep 20 '22 01:09 ScriptAutomate

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.

jonathanyeung avatar Sep 20 '22 09:09 jonathanyeung

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

rlh1994 avatar Sep 20 '22 16:09 rlh1994