farisphp / splitbun

A javascript library that splits text element into individual lines, words, or characters.
MIT License
8 stars 0 forks source link

Split issues with elements that have inner tags #2

Open simom opened 9 months ago

simom commented 9 months ago

Hi there, the plugin is really great, but I'm facing an issue with elements that contain HTML tags. The plugin detects the first word and stops the parsing.

Steps to reproduce the behavior:

  1. Create an element like <h2>Lorem <em>ipsum</em> dolor sit amet</h2>
  2. execute splitBun('h2')
  3. the split will work only for the "Lorem" text.
gempong commented 9 months ago

Thanks for reaching out! We've noted the issue you're facing with HTML tags in the plugin, and we'll definitely look into it. We're on the case!

simom commented 9 months ago

If I could help, this library https://github.com/shshaw/splitting/ is capable of splitting per line, using custom CSS properties to identify the line number. The issue with Splitting is that if you choose "lines" as the splitting mode, the "word" split will also be applied.