Justineo / vue-clamp

Clamping multiline text with ease.
https://vue-clamp.vercel.app
MIT License
698 stars 89 forks source link

raw html support #50

Open bezany opened 3 years ago

bezany commented 3 years ago

Fixes #42 #48

But maybe there is a problem with incorrectly closed tags?

Justineo commented 3 years ago

Thank you for your contribution! But this doesn't seem to be a robust solution for HTML support.

bezany commented 3 years ago

I will try research edge cases soon.

bezany commented 3 years ago

@Justineo I made some changes. Although modern browsers autofix incorrect HTML in innerHTML, I found possible more safe solution. Now vue-clamp get HTML clip function through prop clip. And we can use any library for correct truncate HTML. For example, I found good package text-clipper.

bezany commented 3 years ago

@Justineo Any news? I tried to do possible smallest and safe changes in component. May be sometimes second maxLength arguments for clip function calculates with some error, but it is better then simple truncate html.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/justineo/vue-clamp/3zruFfJCvkd1Dd2ETKGcio3RPHfU
✅ Preview: https://vue-clamp-git-fork-bezany-feature-vhtml-justineo.vercel.app