question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:

  1. Create a new Maizzle project (maizzle new).
  2. On the package.json, change Maizzle version from ^3.0.0 to next.
  3. npm i to install everything.
  4. In config.js, add baseURL: 'https://example.com/foo/'.
  5. In the src/templates.promotional.html template, add the following code at the start of the <block name="template"> block. You can also change the src: variable passed to the vmlbg component to a local image like foobarbaz.jpg.
<!--[if mso]>
<v:image src="foo.jpg" />
<v:image src="bar.jpg" />
<v:image src="baz.jpg" />
<![endif]-->
  1. Run maizzle serve or maizzle 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:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cossssmincommented, May 18, 2022

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>.

0reactions
cossssmincommented, May 19, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found