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...
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 1309384-15.patch | 1.87 KB | jessey |
| #14 | processing-url-rules-for-css-styles-1309384-14.patch | 1.85 KB | ramreddy.kancherla |
| #13 | 1309384-13.patch | 1.96 KB | burnellw_cit |
| #11 | interdiff-10_11.txt | 746 bytes | Oscaner |
| #11 | 1309384-11.patch | 1.86 KB | Oscaner |
Comments
Comment #1
Garrett Albright commentedYou'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)
Comment #2
john franklin commentedWhile 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.
Comment #3
john franklin commentedI'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.
Comment #4
john franklin commentedBetter title.
Comment #5
Garrett Albright commentedThank 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).
Comment #5.0
Garrett Albright commentedcode wasn't showing up...used surrounding tags
Comment #6
Oscaner commentedReopen, this issue still exist on 8.x-1.x version.
Comment #7
Oscaner commentedFor version 1.0.0-alpha1
Comment #8
Oscaner commentedComment #9
Oscaner commentedSeparate the matching of url().
Comment #10
Oscaner commentedReroll for version 1.0.0-alpha2
Comment #11
Oscaner commentedComment #12
dwwThis 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.
Comment #13
burnellw_cit commentedComment #14
ramreddy.kancherla commentedPatch file to support 2.x version.
Comment #15
jessey commented