<divclass="card"><DOCUMENT_FRAGMENT><divclass="mw-parser-output"><h1><spanclass="mw-headline"id="cleaning_up_text">cleaning up text</span><spanclass="mw-editsection"><spanclass="mw-editsection-bracket">[</span><ahref="/mw-mediadesign/index.php?title=User:Simon/Cleaning_up_text&action=edit&section=1"title="Edit section: cleaning up text">edit</a><spanclass="mw-editsection-bracket">]</span></span></h1>
<p>see also<ahref="Being_kind_to_the_reader.html"title="User:Simon/Being kind to the reader">being kind to the reader</a>, <ahref="Editing.html"title="User:Simon/Editing">editing</a>, <ahref="Typing.html"title="User:Simon/Typing">typing</a>
</p><p>A text found in the wild often comes with visible and invisible artefacts. The visible ones come from bad OCR, with strange characters popping up in place of the ones you expect, such as a 1 instead of an l. The bane of the bootlegger is most definitely the line break or “soft return”, inserted by software that automatically breaks the line as you type. Screen-based formats such as EPUB don’t have the notion of a page, and flow text according to window size.
</p><p>You can either be methodical and remove each soft return manually, or use the powerful automated <i>find/replace all</i>option. A useful tactic is to <i>find</i>every instance of a full stop followed by a space where a line was intentionally broken by the human writer. Next, <i>replace</i>each full stop with an arbitrary but uncommon character, such as a dagger (†). Then, do another <i>find/replace</i>and remove every instance of a soft return and a space, and finally <i>replace</i>the uncommon character with a full stop, in one final <i>find/change</i>command.
Another unwanted character that often appears is the hyphen, inserted where words break at the end of a line. Here the pruning of errant characters is trickier, and the best method is to <i>find</i>each instance and remove them manually. Running <i>find/replace all</i>can often remove necessary hyphens, such as in time ranges (e.g. 9-5) and compound adjectives (e.g. inter-dependent).
</p><p>Image: Hidden characters (e.g. tabs, spaces, carriage and ‘soft’ returns)