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

Inserting image with height/width thru insertHTML() method resize automatically #353

Closed
chagonzles opened this issue Apr 28, 2020 · 4 comments
Labels
Milestone

Comments

@chagonzles
Copy link

Hi,

Is there a way to insert images thru .insertHTML() method with size indicated like <img height="100" width="100" src="..." /> ?

Right now when I tried to insert image with height/width indicated it still auto resize.

Thank you.

@chagonzles chagonzles changed the title insertHTML(<img style="height:100px; width:100px" src=".." />) resize automatically Inserting image with height/width thru insertHTML() method resize automatically Apr 28, 2020
@JiHong88
Copy link
Owner

Hi,
The inserted tag has the attributes removed according to the "whitelist" of option.
If you give the second argument value of .insertHTML true, html clean will not work.
And please specify the size in style.

.insertHTML('<img style="height:100px; width:100px;" src="..." />', true)

@chagonzles
Copy link
Author

style="height:100px; width:100px;"

I did try to add .insertHTML('<img style="height:100px; width:100px;" src="..." />', true)
it's inserting the image with the indicated size but then it resets to its original/auto size.
perhaps i need to add the attributes in the whitelist option? can you provide an example?

@JiHong88
Copy link
Owner

JiHong88 commented Apr 28, 2020

Sorry, the "auto" size is being set while re-creating the image format.
It will be fixed once a new version is released this week.
I'll notify you know when the version is updated.

@JiHong88 JiHong88 added bug and removed question labels Apr 28, 2020
@JiHong88 JiHong88 added this to the 2.29.0 milestone Apr 28, 2020
JiHong88 added a commit that referenced this issue Apr 28, 2020
@JiHong88
Copy link
Owner

JiHong88 commented May 8, 2020

The 2.29.0 version has been updated.
If this issue has not been resolved, please reopen this issue.
Thank you.

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

No branches or pull requests

2 participants