You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiMarkdownEditor] Enhancement request: "Newlines -> line breaks" as a default plugin #5141
I notice that, since EuiMarkdownEditor is using Remark to process/render markdown, it follows Remark's default behavior and does not render single newlines as actual line breaks (<br>):
I know this behavior is technically up to spec, and GitHub et al. are doing their own extra processing to make newlines into <br>s, but would you consider adding a default plugin to mimic this newline -> line break processing? There is a Remark plugin called remark-breaks which already does this, and should hopefully be simple to implement. Would this be something you'd consider, or will we need to create our own processing plugin for this?
Would this be something you'd consider, or will we need to create our own processing plugin for this?
This one would be a breaking change, and a potentially significant one as a lot of markdown uses is UGC. The component is marked as beta, but if I were a consumer I'd be unhappy about this change.
Closing this, but if anyone feels strongly otherwise feel free to re-open for discussion.
I disagree that consumers would be unhappy with this change. I think it is the more expected behavior than what it currently does and/or could be a setting that is something like respecteWhiteSpace. I would much rather this approach than to have to create custom plugins to allow for spacing.
This is expected behaviour for markdown.
To insert a br in markdown just use (at least) two spaces at the end of the sentence.
You need to be careful with the implementation, this could be a breaking change, as content that already has double spaces and a new line may now have 2 brs.
I'd like to see this as an opt-in feature as it largely depends on the use-case; for example, markdown on GitHub's issues and comments insert a br without two spaces, whereas its .md file editor (i.e. try editing a README.md) does not, i.e. a text editor that supports markdown, vs a markdown editor.
I'd suggest making this an opt-in feature, as you're doing something differently to the defacto markdown standard.
heya all, (especially @miukimiu), I'm wondering if there's any timeline or prioritization happening on this one? asking because it's something that's preventing us from using EuiMarkdownEditor. totally fine if there's no timeline here, I'll just try writing a custom plugin until this is ready. thanks!
This is something an engineer has to do. So let's see what @chandlerprall says about timeline or prioritization. But I would say if this is something that is not difficult to do, and you have time, you can open a PR instead of writing a custom plugin.
Activity
chandlerprall commentedon Sep 4, 2021
This one would be a breaking change, and a potentially significant one as a lot of markdown uses is UGC. The component is marked as beta, but if I were a consumer I'd be unhappy about this change.
Closing this, but if anyone feels strongly otherwise feel free to re-open for discussion.
cchaos commentedon Sep 4, 2021
I disagree that consumers would be unhappy with this change. I think it is the more expected behavior than what it currently does and/or could be a setting that is something like
respecteWhiteSpace. I would much rather this approach than to have to create custom plugins to allow for spacing.elizabetdev commentedon Sep 6, 2021
I share the same opinions as @cchaos
When I opened the PR #5059 was because I missed something for spacing. So I'll rethink #5059.
chandlerprall commentedon Sep 8, 2021
I'm convinced. I think we should avoid any new prop / configuration and just go with it, and maybe allow opting out with the incoming configuration - elizabetdev@90a669a#diff-d5fec82a5af6bfbe83ee2cee3b7aad4e015f98f57996b8f8eb703a14688efbc0R74.
j-m commentedon Sep 30, 2021
This is expected behaviour for markdown.
To insert a
brin markdown just use (at least) two spaces at the end of the sentence.You need to be careful with the implementation, this could be a breaking change, as content that already has double spaces and a new line may now have 2
brs.I'd like to see this as an opt-in feature as it largely depends on the use-case; for example, markdown on GitHub's issues and comments insert a
brwithout two spaces, whereas its .md file editor (i.e. try editing a README.md) does not, i.e. a text editor that supports markdown, vs a markdown editor.I'd suggest making this an opt-in feature, as you're doing something differently to the defacto markdown standard.
i-a-n commentedon Oct 13, 2021
heya all, (especially @miukimiu), I'm wondering if there's any timeline or prioritization happening on this one? asking because it's something that's preventing us from using
EuiMarkdownEditor. totally fine if there's no timeline here, I'll just try writing a custom plugin until this is ready. thanks!elizabetdev commentedon Oct 14, 2021
Hi @i-a-n,
My first approach was not ideal: #5059. So I closed the issue.
Then I did some experiments locally and talked with @chandlerprall about it. No ideal too.
So we agreed on the following approach:
This is something an engineer has to do. So let's see what @chandlerprall says about timeline or prioritization. But I would say if this is something that is not difficult to do, and you have time, you can open a PR instead of writing a custom plugin.
i-a-n commentedon Oct 14, 2021
perfect, thanks for the update @miukimiu, I'll try to help with that