Skip to content

Conversation

@bezany
Copy link

@bezany bezany commented Dec 21, 2020

Fixes #42 #48

But maybe there is a problem with incorrectly closed tags?

@Justineo
Copy link
Owner

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

@bezany
Copy link
Author

bezany commented Dec 22, 2020

I will try research edge cases soon.

@bezany
Copy link
Author

bezany commented Dec 29, 2020

@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
Copy link
Author

bezany commented Feb 11, 2021

@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.

Copy link
Owner

@Justineo Justineo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've left a few comments.

rawHtml: {
type: Boolean,
default: false
},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather make rawHtml as a string, used like:

<v-clamp :raw-html="html" .../>

@vercel
Copy link

vercel bot commented Mar 24, 2021

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

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

Successfully merging this pull request may close these issues.

Not possible to use html in v-clamp

2 participants