timo-reymann / intellij-mjml-support

MJML support for the IntelliJ Platform.
https://timo-reymann.github.io/intellij-mjml-support/
Other
26 stars 11 forks source link

Resolve local image paths for background-url #145

Closed de-es closed 1 year ago

de-es commented 1 year ago

What happened?

I would expect that the background-url attribute would be resolved the same way the src attribute is for images.

Resolve local image paths is turned on in settings. Resolving src works fine.

Plugin version: 2.3.2

OS

Linux

What IDE are you facing the problem in?

PhpStorm

Problem description

<mj-hero
           mode="fluid-height"
           background-width="600px"
           background-height="338px"
           background-url="path/to/my/image.jpg"
           background-color="#c6c6c6">
            <mj-button background-color="#183A64" href="https://github.com">Go to Github</mj-button>
</mj-hero>

Expected behaviour

<td background="file:///full/path/to/my/image.jpg" style="background:#c6c6c6 url('file:///full/path/to/my/image.jpg') no-repeat center center / cover;background-position:center center;background-repeat:no-repeat;padding:125px 0px;vertical-align:top;">

Actual behaviour

<td background="path/to/my/image.jpg" style="background:#c6c6c6 url('path/to/my/image.jpg') no-repeat center center / cover;background-position:center center;background-repeat:no-repeat;padding:125px 0px;vertical-align:top;">

Steps to Reproduce

Use background-url in any appropriate component.

Using background-url="file:///full/path/to/my/image.jpg" is working as a temporary solution.

Important Factoids

No response

References

86

I read and aggree to the contribution guidelines

timo-reymann commented 1 year ago

Heya @de-es, thanks for creating a issue for this. Will implement and will be released in next version :) Will keep you updated here.

timo-reymann commented 1 year ago

I took a first look, will try to implement it till end of next week :)

Analysis:

Draft for solution

Code adjustment

de-es commented 1 year ago

There's no hurry. Appreciate your immediate feedback.

timo-reymann commented 1 year ago

[NEW SNAPSHOT] Latest snapshot mentioning this issue has been published to marketplace: 2023.02.14-768

timo-reymann commented 1 year ago

Snapshot tested, works fine.

Will release 2.4.0 after approval from Jetbrains will be available for install 🚀

Will close this for now, if you have/remarks with latest release feel free to comment here or create a new issue.

de-es commented 1 year ago

Works fine here too. Thank you very much! :partying_face: