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

Trailing whitespace in element is lost #37

Closed
thisconnect opened this issue May 26, 2020 · 7 comments
Closed

Trailing whitespace in element is lost #37

thisconnect opened this issue May 26, 2020 · 7 comments
Labels
👀 no/external This makes more sense somewhere else

Comments

@thisconnect
Copy link

Subject of the issue

Trailing whitespace in element is lost if followed by text node.

a <strong>b </strong>c

Your environment

  • OS: macOS
  • Packages: rehype
  • Env: Node 12.16.3

Steps to reproduce

I tried to create a test, but I am not confident that it is 100% correct, please double check
#36

Expected behavior

The white space should be inside the strong element

Actual behavior

There is no white space

@thisconnect thisconnect added 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels May 26, 2020
@thisconnect thisconnect changed the title Whitespace Trailing whitespace in element is lost May 26, 2020
@wooorm
Copy link
Member

wooorm commented May 26, 2020

Are you certain this is from rehype core? Could it be one of the plugins?

@thisconnect
Copy link
Author

Are you certain this is from rehype core? Could it be one of the plugins?

Yes it could be from the remark plugins.

Did you see my PR with the test?

I tried to test what I think would be expected, but might have errors sorry.

@thisconnect
Copy link
Author

thisconnect commented May 26, 2020

Could it be one of the plugins?

I checked and it is using more or less:

  1. rehype-parse
  2. rehype-remark
  3. remark-stringify

@thisconnect
Copy link
Author

I could try to create another test somewhere, if you point me to where you think it would make sense.

@wooorm
Copy link
Member

wooorm commented May 30, 2020

Could it be this bug? rehypejs/rehype-minify#19

@wooorm
Copy link
Member

wooorm commented Jun 4, 2020

I think it’s most probably that, which is now fixed: rehypejs/rehype-minify@64c6206. Do let us know if your problem persists.

@wooorm wooorm closed this as completed Jun 4, 2020
@thisconnect
Copy link
Author

The rehype-minify-whitespace is in my dep tree as dependency of hast-util-to-mdast which wants a lower major version. I miserably failed at trying to manually replace it.

Seems to error see the PR syntax-tree/hast-util-to-mdast#60
was there a breaking change?

@wooorm wooorm added 👀 no/external This makes more sense somewhere else and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Jul 23, 2020
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
Development

No branches or pull requests

2 participants