Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 687 Bytes

File metadata and controls

20 lines (15 loc) · 687 Bytes

exciseCodeTags

Simple node.js utility to strip out <code> and <pre> tag content from files.

Overview

While performing some automated tests on some HTML, I found that the test utilities did not always ignore code present within the <code>...</code> or <pre>...</pre> tags.

This node.js utility performs a simple removal of the content within these tags. The <pre>...</pre> tags are assumed to be within prose, and so are replaced by a simple two word phrase. By default, the phrase is "code phrase", but this can be changed easily.

Running the utility

cat <sample_html_file> | node exciseCodeTags.js > <a_different_html_file>