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

Feature request: ignore spaces before a list bullet (was: does not parse bullets very well) #14

Open
sdupuis1 opened this issue Apr 20, 2015 · 7 comments

Comments

@sdupuis1
Copy link

Seems to have issues with spacing
Ex. does not work:
Draw a large face of a clock and place in the numbers \n\n + position the hands for 5 minutes after 11 o'clock \n\n + On your clock, label "L" for the long hand and "S" for the short hand

removing the spaces before the + makes it work. P.S. this should be some text followed by 2 bullet points.

Also had issues when using a * for bullet points.dot have an example handy but it seems to confuse it with emphasis which is also a *

@laptobbe
Copy link
Owner

Hi @sdupuis1

I don't fully understand your problem from your description. Could you share an example of the markdown you are trying to parse and what you expect the result to be.

@sdupuis1
Copy link
Author

Draw a large face of a clock and place in the numbers \n\n + position the hands for 5 minutes after 11 o'clock \n\n + On your clock, label "L" for the long hand and "S" for the short hand

@sdupuis1
Copy link
Author

The below markdown works(note the difference):
Draw a large face of a clock and place in the numbers \n\n+ position the hands for 5 minutes after 11 o'clock \n\n+ On your clock, label "L" for the long hand and "S" for the short hand

@laptobbe
Copy link
Owner

I see the '+' has to be the first char on the line for a list to work. Is this a problem for you? This is usually how you define a list. If you have a suggestion on an improvement on the regex I am happy to merge it. Unfortunately I don't have time to look into this problem right now.

@sdupuis1
Copy link
Author

Add it to your list :) The reason you would want this is if the markdown had a list, then sublist. This is typically done with some space indentation. Thx for at least looking :) I think I may fork you project and add some things.

@Coeur Coeur changed the title does not parse bullets very well Feature request: ignore spaces before a list bullet (was: does not parse bullets very well) Sep 17, 2015
@Coeur
Copy link
Collaborator

Coeur commented Sep 27, 2015

Note that 4 spaces before a '+' sign could be interpreted as a code block in some popular Markdown implementations. So implementing this feature should not allow for an arbitrary number of spaces.

@Coeur
Copy link
Collaborator

Coeur commented Sep 27, 2015

Sublists with spaces (like here on github) are something contextual and might be tricky to parse using regex. See https://en.wikipedia.org/wiki/Chomsky_hierarchy. But then, some NSRegularExpressionAnchorsMatchLines together with look-ahead syntax might help to achieve it.

But I'm concerned with the ambiguity of sublist and code block. I would prefer a multi-sign syntax (like mediaWiki) to a multi-space syntax (like commonmark).

Multi-sign-style:
+ top-level
++ sub-level

This would also be coherent with header multi-sign syntax.

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

3 participants