Open bezany opened 3 years ago
Thank you for your contribution! But this doesn't seem to be a robust solution for HTML support.
I will try research edge cases soon.
@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.
@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.
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
Fixes #42 #48
But maybe there is a problem with incorrectly closed tags?