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

list in directive parsed as spread: true unexpectedly with indents #13

Closed
4 tasks done
JounQin opened this issue Jan 22, 2025 · 5 comments
Closed
4 tasks done

list in directive parsed as spread: true unexpectedly with indents #13

JounQin opened this issue Jan 22, 2025 · 5 comments
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on

Comments

@JounQin
Copy link
Member

JounQin commented Jan 22, 2025

Initial checklist

Affected package

mdast-util-directive

Steps to reproduce

https://astexplorer.net/#/gist/cfda1b4fd45ed9456930ed22b96f4eb4/5571d1f816f9ac0767d2583786fae298877e06c7

Actual behavior

The first list in containerDirective has spread: true, the second list not in containerDirective has spread: false.

Expected behavior

Both should have spread: false

Runtime

v18.20.5

Package manager

yarn@4

Operating system

mac 15.2

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Jan 22, 2025
@JounQin JounQin changed the title list in directive parsed as spread: true unexpectedly list in directive parsed as spread: true unexpectedly with indents Jan 22, 2025
@wooorm
Copy link
Member

wooorm commented Jan 22, 2025

I recommend making your repro smaller: remove everything that isn‘t needed. There are nodes that do not do anything. There’s a directive that doesn’t work because there is a space between : and the name. There are indents that perhaps results in the problem

@wooorm
Copy link
Member

wooorm commented Jan 22, 2025

Smallest repro that I can make for now:

 :::tip
* alpha

 bravo
:::

@JounQin
Copy link
Member Author

JounQin commented Jan 22, 2025

https://astexplorer.net/#/gist/cfda1b4fd45ed9456930ed22b96f4eb4/0f8611e8439d425458d2264d278c7ae92c8626c9

Only the first one has spread: true

  :::tip

  - list 1
  - list 2

  ![img](foo)

  :::
  
  :::tip

  - list 1
  - list 2

  :::
  
:::tip

- list 1
- list 2

![img](foo)

:::

There’s a directive that doesn’t work because there is a space between : and the name.

That was intended to show the difference.

This comment has been minimized.

wooorm added a commit to micromark/micromark-extension-directive that referenced this issue Jan 22, 2025
@wooorm wooorm added the 👀 no/external This makes more sense somewhere else label Jan 22, 2025
@wooorm
Copy link
Member

wooorm commented Jan 22, 2025

Thanks! Solved the external problem. npm update to get it!

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants