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

Why 3 spaces after list bullet? #30

Closed
hotoo opened this issue Jun 27, 2015 · 5 comments
Closed

Why 3 spaces after list bullet? #30

hotoo opened this issue Jun 27, 2015 · 5 comments
Labels
remark 🦋 type/enhancement This is great to have

Comments

@hotoo
Copy link

hotoo commented Jun 27, 2015

* list item

add 2 space use stringify:

-    list item

I just want 1 space after list bullet.

But I can't find any options from https://github.com/wooorm/mdast/blob/master/doc/options.md#list-item-bullets

and I found this in source code:

$ grep -r "'   '" node_modules/mdast
node_modules/mdast/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch:-            return '   ' + line;
@wooorm
Copy link
Member

wooorm commented Jun 27, 2015

The idea here is that tab columns (four characters) have the best support across vendors.
Now, every vendor can parse a simple list, like the example you give, without any problems, but there are compatibility issues when compiling a mixture of block quotes, code blocks, lists, and the like.

When you stick to four-character stops, everything works fine. I try to keep mdast fast when stringifying by only looking at the current node, and not checking edge-case scenarios, and compile differently based on that.

I would like to add that option, but there are cases where other vendors would parse content differently (e.g., as code-blocks), but that’s on the back-burner!

Does that help?

@hotoo
Copy link
Author

hotoo commented Jun 29, 2015

In README you write:

mdast is not just another markdown to HTML compiler. It can generate, and reformat, markdown too.

Usualy format is for people, not only for vendors, and a lot of peoples write markdown use 1 space after list bullet.

I was write a document check tool for support markdown, it just need find text nodes and change it values. I want keey user habit, not change it.


In my case, I want more things like keep user's list bullet, not fixed.

@wooorm
Copy link
Member

wooorm commented Jun 29, 2015

Well this seems to be going into very philosophical direction, so I'll not respond to what markdown is and isn't, in my opinion 😉.

Regarding what reformat means, in the context there I meant “based on options”, not “based on the current style”. Sorry about that, but that's not mdast's goal, yet.

It's inherent to an AST (abstract syntax tree), that not everything is stored. Therefore, not the (exact) style of the user can be kept.

Therefore, the only thing I can do short-term, is add an option to compile use (1 space), instead of a tab-stop. But I cannot—again, yet—help you with style-detection.

@hotoo
Copy link
Author

hotoo commented Jun 29, 2015

Think you for the option.

@wooorm
Copy link
Member

wooorm commented Jun 29, 2015

Thanks for the suggestion. I split this issue, because the first part of your problem is easier/faster to fix, into GH-31 and GH-32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
remark 🦋 type/enhancement This is great to have
Development

No branches or pull requests

2 participants