Because I have a lot of hard-coded block and node assets where properties like 'src' require strings beginning with a slash (VERY weird things happen when this rule is not followed!) I included a Pathologic config in my input formats involving just a single slash to be recognized as 'local'. This fixed hundreds of php snippets and html designs...but it DID NOT fix the following:

<table style="background: #ffffff url(/sites/default/files/images/Storybook/Pangea_StoryBook_1.jpg) no-repeat;" border="0" cellspacing="0" cellpadding="0" width="627">

But, even more curious is the fact that it DOES go ahead and do the filter trick correctly if I remove the slash in front of 'sites'! So, it is 'aware' of the need to filter this property, but it won't apply the treat-as-local rule. I could theoretically go through the site and change all these url() style refs to no slash in the first position...but there are a lot of them...is there a better way? Thanks for giving this some thought...

Comments

Garrett Albright’s picture

Status: Active » Closed (won't fix)

You're right, Pathologic isn't going to find paths that look like that. And it's not finding the path when there's no slash, either - something else is going on there to make it work. Sorry, but once you start doing inline CSS, you're going pretty far afield of Pathologic's intended use case, not to mention good web development processes. I'll pretend I didn't see you write something about using the PHP filter.

-- Garrett (Code nazi)

john franklin’s picture

Status: Closed (won't fix) » Active

While it is poor web design, inline styles are necessary for HTML mail. Webmail providers will, quite sensibly, strip out CSS files to prevent an Email from reformatting their interface.

In the case of HTMl mail or feeds, it may not be the developer or designer that's creating the inline styles. Rather, it could be a module such as MimeMail or Emogrifier that takes the CSS and weaves it into the HTML.

I humbly submit this bug for reconsideration.

john franklin’s picture

StatusFileSize
new2.11 KB

I'll even humbly submit a patch.

This expands out the pattern to find candidate url(...) items to apply the Pathologic love.

it also removes a ? after the "internal: | implode()" grouping because that was matching external URLs such as "https://drupal.org/" but only capturing up to the "http://" portion. Removing it removed a lot of false positives.

BTW, https://www.debuggex.com is about the best thing I've seen for PCRE debugging. It made this patch possible.

john franklin’s picture

Title: single slash rule skips url() function in CSS style » url() rules in CSS style are not processed

Better title.

Garrett Albright’s picture

Status: Active » Closed (won't fix)

Thank you, but I no longer maintain the Drupal 6 branch of Pathologic. Please upgrade to Drupal 7 (it's way past time!), and feel free to submit a patch against that branch (I'm pretty sure it will still have the same problem).

Garrett Albright’s picture

Issue summary: View changes

code wasn't showing up...used surrounding tags

Oscaner’s picture

Version: 6.x-3.4 » 8.x-1.x-dev
Issue summary: View changes
Status: Closed (won't fix) » Needs work

Reopen, this issue still exist on 8.x-1.x version.

Oscaner’s picture

Status: Needs work » Needs review
StatusFileSize
new2.16 KB

For version 1.0.0-alpha1

Oscaner’s picture

Status: Needs review » Needs work
Oscaner’s picture

StatusFileSize
new1.89 KB
new1.15 KB

Separate the matching of url().

Oscaner’s picture

StatusFileSize
new1.85 KB

Reroll for version 1.0.0-alpha2

Oscaner’s picture

StatusFileSize
new1.86 KB
new746 bytes
dww’s picture

Title: url() rules in CSS style are not processed » Add processing for url() rules in CSS styles
Category: Bug report » Feature request
Issue tags: +Needs tests

This seems more like a feature request than a bug report to me. 😉 Inline CSS was never intended to work with pathologic. This seems like adding new cases we could support, not fixing something we intended to work that is broken. Re-category + re-title.

Meanwhile, before this can be seriously considered for commit, we should have some test coverage for this feature. Tagging for that.

burnellw_cit’s picture

StatusFileSize
new1.96 KB
ramreddy.kancherla’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
StatusFileSize
new1.85 KB

Patch file to support 2.x version.

jessey’s picture

StatusFileSize
new1.87 KB