The Un-Official Proxomitron Forum
I ran into a problem... - Printable Version

+- The Un-Official Proxomitron Forum (https://www.prxbx.com/forums)
+-- Forum: Forum Related (/forumdisplay.php?fid=37)
+--- Forum: Privoxy (/forumdisplay.php?fid=49)
+--- Thread: I ran into a problem... (/showthread.php?tid=2243)



I ran into a problem... - Aunt Elsie - Dec. 18, 2015 06:42 PM

I ran into a problem -
<a href="microsoft.com" title="<b>MicroSUCK</b> <font size="2">(Microsoft)</font>"><strong><b>MicroSUCK</b> <font size="2">(Microsoft)</font></strong></a>

Anyone see my problem? This is the page view and it's got to be "unfiltered" some kind of way... Can anyone help me out?

This is what I did,
s| microsoft | <b>MicroSUCK</b> <font size="2">(Microsoft)</font> |sg
Which works very well, except when it's in a Link title. Then it gets very messed up.


RE: I ran into a problem... - Faxopita - Dec. 19, 2015 11:23 AM

My only solution…
Code:
FILTER: Microsoft

  s|(<a\s+href\s*=\s*"[^"]+"[^>]+title\s*=\s*"[^"]+)\s+Microsoft|$1 MicroSUCK|sg
  s|Microsoft|<b>MicroSUCK</b> <font size="2">(Microsoft)</font>|sg
# s|(<a\s+href\s*=\s*"[^"]+"[^>]+title\s*=\s*"[^"]+)\s+MicroSUCK|$1 Microsoft|sg

Comment out or not the last line.


RE: I ran into a problem... - Aunt Elsie - Dec. 19, 2015 07:10 PM

(Dec. 19, 2015 11:23 AM)Faxopita Wrote:  [code]
FILTER: Microsoft

s|(<a\s+href\s*=\s*"[^"]+"[^>]+title\s*=\s*"[^"]+)\s+Microsoft|$1 MicroSUCK|sg
s|Microsoft|<b>MicroSUCK</b> <font size="2">(Microsoft)</font>|sg
Works PERFECTLY!!!

Now...
<title>... Microsoft ...</title>
<meta name="description" content="...">
<meta name="keywords" content="...">
<meta property="og:title" content="..."/>
<meta property="og:description" content="..."/>
<meta name="twitter:title" content="...">
<meta name="twitter:description" content="...">

I tried this:
s|(<title>\s+)\s+Microsoft\s+(\s+</title>)|$1 MicroSUCK $2|sg
Similar to what you did previouly (which worked perfectly, I might add). But Obviously, I didn't get it...

<title>... <b>MicroSUCK</b> <font size="2">(Microsoft)</font>...</title>


RE: I ran into a problem... - Aunt Elsie - Dec. 19, 2015 09:16 PM

You know what? I just realized, this is never going to quit. So, I went back to my original filter -
s| Microsoft | MicroSUCK |sg
And that solved all those and future problems.

But I want to thank you for your support and help. Even though I didn't figure it out, I did learn something.

Again, Thank you.