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

regression in 1.5 release #58

Closed
4 tasks done
tripodsan opened this issue Jan 17, 2023 · 3 comments
Closed
4 tasks done

regression in 1.5 release #58

tripodsan opened this issue Jan 17, 2023 · 3 comments
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on

Comments

@tripodsan
Copy link

Initial checklist

Affected packages and versions

mdast-util-to-markdown 1.5

Link to runnable example

No response

Steps to reproduce

create a simple tree with:

root([
  heading(1, text('Title')),
  text('Hello, world.'),
]);

and generate markdown with 1.4 and 1.5. the results are different.

While I understand, that the MDAST might not be valid in respect to the commonmark spec, I think that changing the context based on the child list in root should have been made in a major release...

Expected behavior

it should produce the same output.

Actual behavior

with 1.4 it produces:

# Title

Hello, world.

with 1.5 it produces:

# TitleHello, world.

Affected runtime and version

node@18

Affected package manager and version

No response

Affected OS and version

No response

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 17, 2023
@wooorm
Copy link
Member

wooorm commented Jan 17, 2023

MDAST might not be valid

Why do you have invalid mdast?

Reminds me a bit of this: https://xkcd.com/1172/.


I consider this change a bugfix. Root nodes can contain any type of content, so long as it is of the same kind. Previously, all content was treated as blocks, which is incorrect. Because in markdown there are often unknown nodes (from the many extensions), the algorithm checks for explicit phrasing nodes (e.g., text or strong or so are always phrasing). When there are known phrasing nodes, the content is thus guaranteed to be phrasing.

@github-actions

This comment was marked as resolved.

@wooorm wooorm added the 🙅 no/wontfix This is not (enough of) an issue for this project label Jan 18, 2023
@github-actions

This comment was marked as resolved.

@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 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants