Only the first VML path is prefixed by baseURL
See original GitHub issue- Maizzle Version: 4.0.0-alpha.8
- Node.js Version: 15.14.0
Hey there! I think I found a bug related to VML images and the use of the baseURL
config. It looks like under Maizzle 4, only the first VML path is prefixed by baseURL. (I checked and this doesn’t seem to appear under Maizzle 3.) Here’s how you can reproduce it:
- Create a new Maizzle project (
maizzle new
). - On the
package.json
, change Maizzle version from^3.0.0
tonext
. npm i
to install everything.- In
config.js
, addbaseURL: 'https://example.com/foo/'
. - In the
src/templates.promotional.html
template, add the following code at the start of the<block name="template">
block. You can also change thesrc:
variable passed to thevmlbg
component to a local image likefoobarbaz.jpg
.
<!--[if mso]>
<v:image src="foo.jpg" />
<v:image src="bar.jpg" />
<v:image src="baz.jpg" />
<![endif]-->
- Run
maizzle serve
ormaizzle build production
.
Expected result
Every image in the email should have its path prefixed by https://example.com/foo/
.
<!--[if mso]>
<v:image src="https://example.com/foo/foo.jpg" />
<v:image src="https://example.com/foo/bar.jpg" />
<v:image src="https://example.com/foo/baz.jpg" />
<![endif]-->
…
<!--[if mso]>
<v:image src="https://example.com/foo/foobarbaz.jpg" xmlns:v="urn:schemas-microsoft-com:vml" style="width:600px;height:400px;" />
…
<![endif]-->
Actual result
Only the very first image within the entire email has its path prefixed by the baseURL
value.
<!--[if mso]>
<v:image src="https://example.com/foo/foo.jpg" />
<v:image src="bar.jpg" />
<v:image src="baz.jpg" />
<![endif]-->
…
<!--[if mso]>
<v:image src="foobarbaz.jpg" xmlns:v="urn:schemas-microsoft-com:vml" style="width:600px;height:400px;" />
…
<![endif]-->
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
[BUG] Final request URL is malformed when using ... - GitHub
Describe the bug. When using base URL which doesn't end with / and request URL which starts / merged URL is malformed and...
Read more >PHP: How to get base URL from HTML page - Stack Overflow
So, first problem is to find the base URL from those and other URLs. The second problem is that some HTML pages contain...
Read more >path - Velo API Reference - Wix.com
Gets the path of the current page's URL. The path for a regular page is after the baseUrl If the page is a...
Read more >Understand Default URL Pattern - Contentstack
Prefix URL: Denotes the path where the entry resides. For example, /seo/blog; Entry-specific URL: Denotes the URL of the entry. For example, /my-first-page....
Read more >Releases - Pandoc
Furthermore, the classes image and placeholder are added, and path and title are store in attributes original-image-src and original-image-title ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, thanks so much for catching this and for the detailed report!
It’s a bug indeed, the function that rewrites VML
src
URLs only handles the first match of either<v:image>
or<v:fill>
.Now available in alpha9:
https://github.com/maizzle/framework/releases/tag/v4.0.0-alpha.9