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

comment in markdown after indented line causes previous line to be joined to line before that #8397

Open
trusktr opened this issue May 25, 2020 · 2 comments
Labels
lang:markdown Issues affecting Markdown type:bug Issues identifying ugly output, or a defect in the program

Comments

@trusktr
Copy link

trusktr commented May 25, 2020

Prettier 2.0.5

Works: Playground link

Not working: Playground link (causes the last bullet point to be joined with the parent bullet point)

Screenshot shows when I run prettier:

format

module.exports = {
	tabWidth: 4,
	useTabs: true,
	semi: false,
	singleQuote: true,
	trailingComma: 'all',
	bracketSpacing: false,
	printWidth: 120,
	arrowParens: 'avoid',
	overrides: [
		{
			files: '*.md',
			options: {
				tabWidth: 2,
			},
		},
	],
}

Input:

* **API Reference**
  <!-- __API_AUTOGENERATED_BEGIN__ -->
  - components/
    - [Cube](/api/components/Cube.md)
  - core/
    - [ImperativeBase](/api/core/ImperativeBase.md)
    - [Node](/api/core/Node.md)
    - [TreeNode](/api/core/TreeNode.md)
  - html/
    - [WithUpdate](/api/html/WithUpdate.md)
<!-- __API_AUTOGENERATED_END__ -->

Output:

- **API Reference**
    <!-- __API_AUTOGENERATED_BEGIN__ -->
  - components/
    - [Cube](/api/components/Cube.md)
  - core/
    - [ImperativeBase](/api/core/ImperativeBase.md)
    - [Node](/api/core/Node.md)
    - [TreeNode](/api/core/TreeNode.md)
  - html/ - [WithUpdate](/api/html/WithUpdate.md)
  <!-- __API_AUTOGENERATED_END__ -->

Expected behavior:

It should not join the last bullet point with the previous bullet point, right?

Love the tool! :)

@thorn0 thorn0 added lang:markdown Issues affecting Markdown type:bug Issues identifying ugly output, or a defect in the program labels May 25, 2020
@jeremenichelli
Copy link

Something similar happens when a quote is surrounded by markup (which is valid Markdown):

> <q>What's up</q>
> <cite>Bugs Bunny<cite>

The code snippet above is formatted to:

> <q>What's up</q> > <cite>Bugs Bunny<cite>

Which changes the result of the rendered content. I don't know if they are related but I didn't want to open a new issue and introduce more noise to the repository, but at least raise awareness of this behavior and the possible correlation with this issue reported.

@robole
Copy link

robole commented Jul 30, 2020

For an indented list with a comment before and after, it breaks the list up. The tab width used is 2 spaces, and I am using the default prettier options (2 spaces is the default width).

Input

<!-- TOC -->
- [2. Test Header 2z](#2-test-header-2z)
- [2.1 Test Header 2.1](#21-test-header-21)
	- [2.1.1 level 3](#211-level-3)
		- [2.1.1.1 level 4](#2111-level-4)
			- [2.1.1.1.1 level 5](#21111-level-5)
				- [2.1.1.1.1.1 level 6](#211111-level-6)
				- [2.1.1.1.1.2 Bevezető level 6](#211112-bevezető-level-6)
<!-- /TOC -->

Output

<!-- TOC -->

- [2. Test Header 2z](#2-test-header-2z)
- [2.1 Test Header 2.1](#21-test-header-21) - [2.1.1 level 3](#211-level-3) - [2.1.1.1 level 4](#2111-level-4) - [2.1.1.1.1 level 5](#21111-level-5) - [2.1.1.1.1.1 level 6](#211111-level-6) - [2.1.1.1.1.2 Bevezető level 6](#211112-bevezető-level-6)
<!-- /TOC -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang:markdown Issues affecting Markdown type:bug Issues identifying ugly output, or a defect in the program
Projects
None yet
Development

No branches or pull requests

4 participants