Lundalogik / lime-elements

Provides reusable web components for Lime CRM
https://lundalogik.github.io/lime-elements/versions/latest
Other
38 stars 11 forks source link

feat(markdown): allow `height` and `width` in inline `style` attribute #2922

Closed adrianschmidt closed 5 months ago

adrianschmidt commented 5 months ago

fix: Lundalogik/limepkg-email#695

This can be tested by adding the following snippet to the composite example for limel-markdown in the docs for this PR and compare to the result when using the docs for the latest release.

<img
    border="0"
    style="width: 0.3229in; height: 0.3229in;"
    src="https://lundalogik.github.io/lime-elements/versions/latest/favicon.svg"
    alt="signature_2123812728"
/>
<br>
<br>
<img
    border="0"
    width="31"
    height="31"
    src="https://lundalogik.github.io/lime-elements/versions/latest/favicon.svg"
    alt="signature_2123812728"
/>

The result should look like this:

Both images in the screenshot are approximately 31 by 31 pixels

Review:

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

Linux:

macOS:

Mobile:

github-actions[bot] commented 5 months ago

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-2922/

FredrikWallstrom commented 5 months ago

I tested this, it works like a charm. Works both if I have width and height as separate attribute, or within the style attribute 🎉

adrianschmidt commented 5 months ago

@FredrikWallstrom Nice to hear!

FYI: I was considering whitelisting max-height and max-width too, but then thought that it's probably better if we can keep those for our own use. If a css property is set in an inline style attribute, that overrides any value set in a stylesheet. So by not allowing max-height and max-width, it should be possible for us to set those values ourselves, and thereby enforcing certain limitations on the content of the activity items. I just want to put that info in the back of your mind, so if you were to run into trouble with image sizes in emails, you might have an idea of why. My hope is that you won't need those values whitelisted, but if it turns out you do, it's simple to add 👍

adrianschmidt commented 5 months ago

Anyone up for approving this PR then? 😊

lime-opensource commented 5 months ago

:tada: This PR is included in version 37.20.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: