Text transformation guides

Strip HTML while choosing what happens to entities

·

Some field-note systems expect the literal spelling of an entity. Others expect the displayed symbol. Use this example to check both forms before you move the note and its spacing into another system.

HTML Strip Tags

Compare the two versions of the field note

Select Load example and Strip tags. The first line shows Field note & ✓ as written. The next line starts with two spaces before the Arabic word أهلاً. The paragraph tags are removed.

Turn on Decode HTML entities and strip again. The first line now contains a nonbreaking space, an ampersand and a check mark. The second line contains the literal characters <12>. Download this version if the receiving system expects those characters.

HTML field note with Arabic, entities and style
<p>Field&nbsp;note &amp; &#x2713;</p><p lang="ar">  أهلاً &lt;12&gt;</p><style>.mark{color:#246}</style>

WHATWG HTML — Named character references

Change the line breaks and spacing independently

Turn off Insert block breaks and run the example again. Its two paragraphs join because the source has no newline between them. The two literal spaces before the Arabic word remain.

Turn on Collapse ASCII whitespace to reduce a horizontal run to one space or a run containing a line ending to one LF. A decoded nonbreaking space stays intact. Trim outer ASCII whitespace affects the beginning and end of the whole result.

WHATWG HTML — Tokenization and whitespace behavior

Include the style text in a separate export

Turn on Keep script and style contents and strip again. The final piece of text is .mark{color:#246}. It can be reviewed or copied as source text.

The result is a text file. Entity decoding happens once. For example, &amp;lt; becomes &lt; after one decode. Use the output as text in the destination.

WHATWG HTML — Tokenization and whitespace behavior

Common questions

Does removal depend on the page’s CSS?

The tool follows HTML syntax and source order. It does not apply visibility rules, generate list bullets, or resolve link destinations.

Why can a downloaded line ending differ from the preview?

A browser text field displays CRLF and LF as a single line break. Open a UTF-8 file and leave whitespace changes off to preserve stored endings in the text download.

Sources

Put it into practice.

Related guides