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

[Suggestion]: Remove delimiting modifiers #50

Open
boltlessengineer opened this issue Jan 2, 2025 · 1 comment
Open

[Suggestion]: Remove delimiting modifiers #50

boltlessengineer opened this issue Jan 2, 2025 · 1 comment

Comments

@boltlessengineer
Copy link

Problem

* Heading level 1
** Heading level 2
*** Heading level 3
**** Heading level 4
***** Heading level 5
      ---
     ---
    ---
   Text under second level heading
===
Text in root level of document

User need to use multiple weak delimiting modifiers to close a middle level heading; heading with level that is lower than root but higher than current. But it is really hard to know how many weak delimiting modifiers are needed to go back to exact heading level in the middle of the long document.

Solution

Replace both delimiting modifiers with empty heading (prefix without following paragraph.)

* Heading level 1
** Heading level 2
*** Heading level 3
**** Heading level 4
***** Heading level 5
***
   Text under Second level heading
*
Text in root level of document

Benefits

  • can be explicit about which level of heading it will close.
  • doing a job of two syntax elements (weak delimiting modifier & strong delimiting modifier), resulting less special punctuation and easier to parse
  • can close middle level heading easily
  • prevent closing heading while typeing level 3+ list item prefix. this was annoying
@boltlessengineer
Copy link
Author

Alternatively, we can implement same thing by just allowing heading without title.

* Heading level 1                    (heading title: (title)
** Heading level 2                     (heading title: (title)
*** Heading level 3                      (heading title: (title)
**** Heading level 4                       (heading title: (title)
***** Heading level 5                        (heading title: (title))))
***                                      (heading
   Text under Second level heading         (paragraph))))
*                                    (heading
Text in root level of document         (paragraph))

By syntax, paragraph 1 is at level 3 and not 2. But as there is no title in heading, user won't notice the difference.
In this implementation, we won't have level 0 though (except blocks above the first heading in document)

* heading 1
  paragraph --- level 1
*
paragraph ----- level 1 (but outside of heading 1)

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

1 participant