Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Finding changed words

by extremely (Priest)
on Sep 16, 2000 at 01:35 UTC ( [id://32749]=note: print w/replies, xml ) Need Help??


in reply to Finding changed words

No one answered half your question so I'll take a stab at it. You need the "bolding" to survive the conversion process to "entities".

The number one suggestion would be to run both texts thru encode_entities BEFORE comparing them. Then your added HTML is safe. A second suggestion would be to use a special chracter that can't appear in the body. like \0175 or some really low char like \f the formfeed char. encode_entities will likely grab that and turn it into something like ý or some so that after encode_entities you can regexp that marker with the html you want. Use one marker for bold on and one for bold off.

--
$you = new YOU;
honk() if $you->love(perl)

Replies are listed 'Best First'.
RE: Re: Finding changed words
by tye (Sage) on Sep 16, 2000 at 01:47 UTC

    FYI, my solution encoded HTML entities by hand during output so the bolding code doesn't get turned into entities.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://32749]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found