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

Shift+Enter Newline #102

Open
markus-gx opened this issue Sep 26, 2024 · 3 comments
Open

Shift+Enter Newline #102

markus-gx opened this issue Sep 26, 2024 · 3 comments
Labels
bug Something isn't working pending-triage [Issue] Ticket is pending to be prioritised

Comments

@markus-gx
Copy link

When migrating from the deprecated richTextResolver to the new one storyblok/richtext, text's with a SHIFT+Enter (newline) do have a separate new line now.

Expected Behavior

Just one <br/> tag instead of two.

Current Behavior

Two br-tags are generated. I guess the one with a key attribute are correct, since the new RichTextResovler works like that, but the other one is incorrect.

<br key="br-4">
<br>
text
<br key="br-6">
<br>
@mlev
Copy link

mlev commented Sep 30, 2024

I get this too. It looks like they fixed it a while ago but never published the release. #90

@alvarosabu alvarosabu added bug Something isn't working pending-triage [Issue] Ticket is pending to be prioritised labels Oct 1, 2024
@mlev
Copy link

mlev commented Oct 3, 2024

I still get this issue with 2.0.1 and 2.1.0. It seems like the released code doesn't include the latest changes. If I copy the code directly into my project and override the renderFn then it works fine.

As far as I can tell this is what the defaultRenderFn gets compiled into in the current releases - and it doesn't include the self closing logic.

function D(e, r = {}, a) {
  const d = x(r);
  return `<${d ? `${e} ${d}` : e}>${Array.isArray(a) ? a.join("") : a || ""}</${e}>`;
}

@alvarosabu
Copy link
Contributor

Hi @markus-gx do you have a reproduction?

I have brs in the playground one, but they are not duplicated. I did some changes for the v3 but not sure if this would be solved there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending-triage [Issue] Ticket is pending to be prioritised
Projects
None yet
Development

No branches or pull requests

3 participants