Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Convert HTML Email message to plain text

by merlyn (Sage)
on Oct 30, 2009 at 04:04 UTC ( #804100=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Convert HTML Email message to plain text
in thread Convert HTML Email message to plain text

No. Imagine the semantic content differences of:

  • He had three pieces of pie.
  • He had three pieces of pie.
  • He had three pieces of pie.
  • He had three pieces of pie.
  • He had three pieces of pie.
And now remove the bolding. You can't distinguish those. The semantic content is in the bolding. If you had only ASCII, you might add *markup* or _something_ to provide the right emphasis. But if you just rip out the HTML coding, you have indeed lost something.

This is quite common. I don't know why you think it's rare. :)

-- Randal L. Schwartz, Perl hacker

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.


Comment on Re^5: Convert HTML Email message to plain text
Re^6: Convert HTML Email message to plain text
by bajangerry (Novice) on Oct 30, 2009 at 12:04 UTC

    Ok, I get your point but for my application I just need to remove ALL HTML formating and be just left with the text of the document. I do not care if I loose semantic content as it will be of little importance in this particular application.

    Could you please point out which of the many examples shown in the initial link I received would be best for that purpose?

    Thanks again guys

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-08-29 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (288 votes), past polls