Jump to content
Search Community

Preserve multiple <br> on SplitText

sombrilla
Moderator Tag

Recommended Posts

Posted

Hello everyone!

 

I'm currently struggling with keeping multiple <br> on a SplitText.

With a single <br> it works fine, it creates a new div for each line, when I try to add multiple the same thing happens but no space is created for each subsequent <br>, in this case I need the <br>s to keep its space so that when I revert it, it doesn't jump.

 

I've tried with reduceWhiteSpace: false, but same issue.

 

Thank you for your time!

 

Minimal reproduction:

See the Pen OJYOooJ by sombrilla (@sombrilla) on CodePen.

Posted

For anyone wondering I worked around this by replacing <br> tags with a custom <span> that simulates a <br> based on this solution.

 

Codepen: 

See the Pen jOoYyqp by sombrilla (@sombrilla) on CodePen.

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...