Problem/Motivation

The regex in \Drupal\mailchimp_campaign\Plugin\Filter\FilterMailchimpCampaign::convertUrl doesn't match HTML tags that are spread over multiple lines (this can happen in Twig templates), leading to some links not be converted to absolute links.

Steps to reproduce

Build a campaign with the following example HTML, the link will not be converted to an absolute link.

This is a test campaign.

<a
         href="/node/1">First node</a>

Proposed resolution

In the regex, use a character class that matches any character, except the tag's closing bracket: [^>]*?. See attached patch.

Comments

brunodbo created an issue. See original summary.

brunodbo’s picture

Status: Active » Needs review
StatusFileSize
new762 bytes
brunodbo’s picture

Issue summary: View changes

  • xenophyle committed 53821dbb on 2.x
    Issue #3450472 by brunodbo: Match new lines in convertUrl regex
    
xenophyle’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.