Opened 10 years ago

Closed 9 years ago

#284 closed enhancement (fixed)

Email-safe entities.

Reported by: aschmidt@… Owned by: gogo
Priority: low Milestone: Version 1.0
Component: Xinha Core Version: trunk
Severity: normal Keywords: email entity patch
Cc:

Description

I added the following to the end of HTMLArea.prototype.outwardHtml to make entities safe for email, and I thought it might be worth sharing. I didn't know how you wanted patches submitted, but at least it's short:

// Entities will have been interpreted. Un-interpret the ones that are not
// email-safe.
html = html.replace(/[\u0080-\uffff]/g,function(c){ return '&#'+c.charCodeAt(0)+';';});
return html;

In real life, you'd probably want to make a config preference so folks could turn it off if they didn't like it.

Attachments (1)

emailsafe.patch (504 bytes) - added by aschmidt@… 9 years ago.
This change, but using a config option to trigger it.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 10 years ago by gogo

  • Keywords patch added
  • Milestone set to Version 1.0

Changed 9 years ago by aschmidt@…

This change, but using a config option to trigger it.

comment:2 Changed 9 years ago by gogo

  • Resolution set to fixed
  • Status changed from new to closed

Committed something similar in changeset:265 , just set xinha_config.sevenBitClean = true

Note: See TracTickets for help on using tickets.