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

Clamping text with <br> tags #2

Open
snewcomer opened this issue May 23, 2018 · 1 comment
Open

Clamping text with <br> tags #2

snewcomer opened this issue May 23, 2018 · 1 comment

Comments

@snewcomer
Copy link

Currently I am having trouble clamping text that has
tags in it. Debugging this library it seems that it will eventually pull off the lastChild and perform truncation on that (Other text as show below).

My text
<br><br>
Other text

Just off the top of my head, it seems the only way for this to work is if the whole innerHTML was truncated as a string rather than looping to find the last child.

Is that your understanding as well? If it doesn't fit this use case, that is ok too! Still debugging this library and seeing how I can help.

@alexandremoore
Copy link
Contributor

The library does support html tags, but it looks like it doesn't deal with single html tags or empty element (i.e. <br>, <hr>, <img>, etc) properly.

I'll try to look at it whenever I will have time.

As a workaround, I guess you could wrap your text inside a <p> tag like this:

<p>My text</p>
<p>Other text</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants