Posted
·
Edited by pjwiebe Spent more time with potential solution.
I think I have found a bit of a workaround since I absolutely need whitespace characters to be wrapped in a div with the rest of the text characters - I am using SplitText.
My solution: swap all whitespace characters out with ` ` before splitting text.
One thing to note is that it breaks being able to animate based on words but it doesn't seem like that is necessary for you or for me.
I will post more edits as I work with this potential solution.
Include white-space in SplitText.chars
in GSAP
Posted · Edited by pjwiebe
Spent more time with potential solution.
I think I have found a bit of a workaround since I absolutely need whitespace characters to be wrapped in a div with the rest of the text characters - I am using SplitText.
My solution: swap all whitespace characters out with ` ` before splitting text.
One thing to note is that it breaks being able to animate based on words but it doesn't seem like that is necessary for you or for me.
I will post more edits as I work with this potential solution.