Skip to content
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

Cicero Draft normalises indents to 3 spaces instead of the standard 4 #398

Open
OliverTod opened this issue Jan 7, 2021 · 1 comment
Open

Comments

@OliverTod
Copy link

Describe the bug
Running cicero draft over a template grammar file to create a sample.md file results in indents being normalised to only having three spaces. This can result in inconsistencies in certain implementations where a list item were intended to be sublists but are instead normalised to being on the same level.

From the CommonMark standard:
"the position of the text after the list marker determines how much indentation is needed in subsequent blocks in the list item. If the list marker takes up two spaces, and there are three spaces between the list marker and the next non-whitespace character, then blocks must be indented five spaces in order to fall under the list item."

To Reproduce
Steps to reproduce the behavior:

  1. Create a simple template grammar which uses an indented list (see screenshot 1)
  2. Run cicero draft command (output is screenshot 2)
  3. Attempt to view resultant markdown file (the VSCode default 'preview' for example) (see screenshot 3)

Expected behavior
Relative position of lists and sublists established in the template grammar should be preserved.

Screenshots
1: four spaces
2: three spaces
3: error

Further context
From the CommonMark spec:
"Indentation. If a sequence of lines Ls constitutes a list item according to rule accordproject/template-archive#1, accordproject/template-archive#2, or accordproject/template-archive#3, then the result of indenting each line of Ls by 1-3 spaces (the same for each line) also constitutes a list item with the same contents and attributes. If a line is empty, then it need not be indented."

See the significant discussion on this point in the commonmark spec

@jeromesimeon
Copy link
Member

This issue should be discussed and addressed in the markdown-transform project, which powers the draft and parse commands (or generally any markdown-related processing). I'm transferring this issue there.

@jeromesimeon jeromesimeon transferred this issue from accordproject/template-archive May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants