mozilla-b2g/notes — pull request #9 by yor-mozilla-com (2014-01-14 06:08:15+00:00)
Title: Fix for bug 916341

Note content is stored as HTML. However, Firefox OS Mail app
does not support sending HTML body, only as attachments. The
fix is to send a text only body, by stripping note content of
all markups, and include the full HTML as an attachment.

Converting HTML to text involves:

1. Formatting of ordered and unordered lists with the appropriate
ASCII equivalent - numbers and asterisks.

2. Formatting checkboxes with either a space for unchecked or an
"x" for checked.

3. Remove all HTML markups.

Full HTML attachment involves:

4. Replacing blob image references with base64 encoded inline image
data.