Closed vvenv closed 3 years ago
join from options should have a higher priority.
Why?
It's useful for handling list/listItem spread logic.
Yes, but it already supports that?
the test join
function your provide returns zero lines between anything, which will break markdown. Can you provide the actual use case you have?
It's useful for handling list/listItem spread logic.
You can change the spread
field on nodes for that?
join from options should have a higher priority.
Why?
It's useful for handling list/listItem spread logic.
Yes, but it already supports that?
the test
join
function your provide returns zero lines between anything, which will break markdown. Can you provide the actual use case you have?
The test case is the actual use case (If I add list/listitem conditions to the join
function). In the case, I want to remove all unneccesary newLine to remove unneccesary <p>
, just like what CKEDITOR5 is doing.
Here is the real case, a markdown WYSIWYG editor based on CKEDITOR5:
The extra new lines make the test html2markdown(markdown2html(value)) === value
broken.
It's useful for handling list/listItem spread logic.
You can change the
spread
field on nodes for that?
Yes, I can, with a custom plugin.
But I really think it's more common to increase the priority of custom join
.
The code you linked does not include mdast-util-to-markdown
— what am I looking at?
The extra new lines make the test
html2markdown(markdown2html(value))
=== value broken.
Sounds like html2markdown(markdown2html(value))
is broken?
Yes, I can, with a custom plugin.
This is my suggestion
The test case is the actual use case (If I add list/listitem conditions to the join function). In the case, I want to remove all unneccesary newLine to remove unneccesary
<p>
, just like what CKEDITOR5 is doing.
Please show that actual code, because right now you’re breaking all of markdown.
How many join functions do you have? If you return undefined
from a join, the next one already kicks in.
Assuming you do not pass tightDefinitions
, then there are no join functions, meaning the order is exactly as how you pass them. You can pass them inverted yourself
Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing more info. It’s not clear yet whether this is an issue. Here are a couple tips:
Thanks, — bb
The code you linked does not include
mdast-util-to-markdown
— what am I looking at?The extra new lines make the test
html2markdown(markdown2html(value))
=== value broken.Sounds like
html2markdown(markdown2html(value))
is broken?Please show that actual code, because right now you’re breaking all of markdown.
How many join functions do you have? If you return
undefined
from a join, the next one already kicks in.Assuming you do not pass
tightDefinitions
, then there are no join functions, meaning the order is exactly as how you pass them. You can pass them inverted yourself
html2markdown(markdown2html(value))
should equal value
, but NOT.1
or 0
always in the case, that make custom join
never hit.After all, the change really breaking all of markdown.
Maybe a custom plugin is the best solution. Maybe I should do more try and test.
Thanks for your patience.
Ah, nice catch, I get it now!
html2markdown(markdown2html(value))
should equal value, but NOT.
Are you using mdast-util-to-hast and hast-util-to-mdast for this? Or something else? Sounds like that is a separate bug?
Hi! This is accepted and can go somewhere!
Team: please review this PR and use the area/*
(to describe the scope of the change), platform/*
(if this is related to a specific one), and semver/*
and type/*
labels to annotate this.
html2markdown(markdown2html(value))
should equal value, but NOT.Are you using mdast-util-to-hast and hast-util-to-mdast for this? Or something else? Sounds like that is a separate bug?
Yes, for some plugins.
Hi! This was closed. Team: If this was merged, please describe when this is likely to be released. Otherwise, please add one of the no/*
labels.
Thanks, released! https://github.com/syntax-tree/mdast-util-to-markdown/releases/tag/1.0.1
Initial checklist
Description of changes
join
from options should have a higher priority. It's useful for handling list/listItem spread logic.