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

Markdown nested lists are not indented properly #3679

Closed
iamcam opened this issue Jan 9, 2018 · 6 comments
Closed

Markdown nested lists are not indented properly #3679

iamcam opened this issue Jan 9, 2018 · 6 comments
Labels
lang:markdown Issues affecting Markdown locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:enhancement A potential new feature to be added, or an improvement to how we print something
Milestone

Comments

@iamcam
Copy link

iamcam commented Jan 9, 2018

Prettier 1.9.2
Playground link

--parser markdown

Input:

# Markdown Test

* A lit item
    * Bitbucket markdown requires 4 spaces for nested list items (https://stackoverflow.com/a/37594372)
* Pretter indents to 2 spaces (tab width doesn't seem to affect it)

Output:

# Markdown Test

* A lit item
  * Bitbucket markdown requires 4 spaces for nested list items (https://stackoverflow.com/a/37594372)
* Pretter indents to 2 spaces (tab width doesn't seem to affect it)

Expected behavior:

The nested list items require 4 spaces for proper display formatting in Bitbucket (likely others. see this SO https://stackoverflow.com/editing-help#advanced-lists )

@vjeux
Copy link
Contributor

vjeux commented Jan 9, 2018

It seems like prettier doesn't even respect tab-width for this :(

@ikatyang
Copy link
Member

ikatyang commented Jan 9, 2018

FYI, the reason why we did not respect tabWidth/useTabs, see #3223 and #3463 (comment).

The markdown renderer used by BitBucket is really weird... I'm not sure what should we do here, see #3531 (comment).

@ikatyang ikatyang added status:needs discussion Issues needing discussion and a decision to be made before action can be taken lang:markdown Issues affecting Markdown labels Jan 9, 2018
@duailibe
Copy link
Member

duailibe commented Jan 9, 2018

What would be the downside of simply changing the nested lists indentation from 2 to 4?

@iamcam
Copy link
Author

iamcam commented Jan 9, 2018

Docs: https://bitbucket.org/tutorials/markdowndemo/overview#markdown-header-lists

I'll submit a feature/bug to their Jira and see what comes of it. I think a few links to widely-used parsers (common mark, GitHub, and SO) could help sway them. Lists aren't the only things that get screwy in Bitbucket md, but they're certainly the biggest pain points when I bring docs in from other sources.

@iamcam
Copy link
Author

iamcam commented Jan 9, 2018

In the meantime, would it be such a big deal to infer the intent of nested list items and just make the indention 4 spaces (or two - give us a setting)?

@ikatyang
Copy link
Member

After second thought, we can respect tabWidth here.

@ikatyang ikatyang added type:enhancement A potential new feature to be added, or an improvement to how we print something and removed status:needs discussion Issues needing discussion and a decision to be made before action can be taken labels Jan 10, 2018
@ikatyang ikatyang added the status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! label Jan 10, 2018
@azz azz closed this as completed in #3694 Jan 10, 2018
@azz azz added this to the 1.10 milestone Jan 10, 2018
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lang:markdown Issues affecting Markdown locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:has pr Issues with an accompanying pull request. These issues will probably be fixed soon! type:enhancement A potential new feature to be added, or an improvement to how we print something
Projects
None yet
Development

No branches or pull requests

5 participants