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

raw html support #50

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

raw html support #50

wants to merge 8 commits into from

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.

src/App.vue Outdated Show resolved Hide resolved
src/App.vue Outdated Show resolved Hide resolved
src/App.vue Outdated Show resolved Hide resolved
src/App.vue Outdated Show resolved Hide resolved
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