I think that the Pathologic filter should not run when inside the context of a code block. On the Drupalize.Me site this is giving us some issues when displaying examples of Twig code.

Here is an example

// Should process href
<p>This is some <a href="/node/1">text</a></p>

// Should not process href
&#x3C;code&#x3E;
<a href="{{ test_url }}">something</a>
&#x3C;/code&#x3E;

In this case the 2nd block of text currently has the value of the href attribute updated, and it becomes a somewhat garbled and url encoded string. Making the block of code illegible.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eojthebrave created an issue. See original summary.

eojthebrave’s picture

Issue summary: View changes
eojthebrave’s picture

Status: Active » Needs review
FileSize
670 bytes

The attached patch updates the regular expression used to locate attributes that the pathologic filter should be run on so that it skips all the text inside of a code block.

Consider the following inside a code block.

Before regex update:

{# Link to a page display of a frontpage view #}
<a href="http://dme.kbox/%7B%7B%20url%28%27view.frontpage.page_1%27%29%20%7D%7D">{{ 'View front page content'|t }}</a>;

After update:

{# Link to a page display of a frontpage view #}
<a href="{{ url('view.frontpage.page_1') }}">{{ 'View front page content'|t }}</a>
eojthebrave’s picture

Version: 7.x-3.x-dev » 2.0.x-dev
FileSize
660 bytes

Update for latest version of the module.