Keep the spaces that belong to the sentence
A language reviewer can approve every word and still see an unusable paragraph on the website. The problem may occur after review, when an editor’s content passes through an export or publishing adapter.
This fictional craft-catalogue case follows one approved Spanish paragraph through that boundary. It uses an inspected HTML-based editor, a deliberately small fixture and an isolated preview. The task is to preserve the approved sentence and its useful inline formatting, not ask the translator to repair an error introduced by software.
Establish the approved paragraph
The collection owner and Spanish reviewer approve this text for item T-41:
“Tejido a mano por el taller. Consulta la ficha antes de solicitar una muestra.”
The phrase “a mano” is emphasised in the editor. The second sentence contains a link on “la ficha” to the item’s approved document. The paragraph’s words, spaces and punctuation form the approved content. The link target and item identity are also recorded.
In the editor’s HTML, the first sentence is represented by text before the emphasis, the emphasized phrase and text after it: Tejido , a mano, por el taller.. The spaces at those boundaries separate words. They are not accidental indentation around a document.
The source preview reads correctly. The published preview instead shows “Tejidoa manopor el taller.” The document link still reaches the intended file, but the sentence no longer presents the approved wording naturally.
Compare each stage of the journey
The developer inspects the saved source and the material received by the publishing adapter. Both retain the boundary spaces. The adapter walks individual text nodes and applies trimming to each one before rebuilding the paragraph.
That operation removes the trailing space after “Tejido” and the leading space before “por”. Concatenating the resulting segments cannot restore information that the adapter discarded. Changing a font or increasing the space between letters would hide neither cause nor result reliably.
The DOM Standard describes descendant text content as the ordered concatenation of text-node data. A formatting element does not automatically supply a word separator. The application must preserve the content that belongs between the words.
The comparison is specific. Accents have not been changed. The translation is not missing. The source record is still T-41, and the document target remains correct. The defect lies in trimming every inline segment as though each were a separate field.
Set the publishing rule at the right boundary
The corrected adapter preserves text-node data within the approved paragraph and retains the permitted inline emphasis and link structure. It no longer trims each segment independently. Any cleanup of an outer input field follows a separately agreed rule; it is not applied indiscriminately inside rich text.
The team also rejects a tempting shortcut: add a space whenever two elements meet. That would change punctuation and text deliberately split inside a word. The correct relationship comes from the source, not a guess based on the presence of an HTML tag.
The adapter continues to apply its existing allowed-element and safe-link handling. Preserving spaces is not a reason to accept arbitrary markup. Those controls are distinct from the text transformation being repaired and need to remain effective.
Use controls that discriminate between fixes
The review includes three short source fixtures in addition to T-41. They make it possible to distinguish preservation from a blanket insertion of spaces.
| Source purpose | Approved readable result | What it checks |
|---|---|---|
| Emphasis within T-41’s sentence | Tejido a mano por el taller. | Spaces on both sides of the emphasized phrase |
| A linked instruction followed by punctuation | Lee la ficha, luego consulta. | No invented space before the comma |
| An approved identifier split by inline styling | AB-41 | No space inserted into one identifier |
| Two separate paragraphs | Two separate paragraphs in the preview | Structure retained, rather than all text flattened together |
The corrected isolated publication reproduces T-41’s full approved paragraph. Its emphasis remains on “a mano”, and the linked phrase reaches the same approved document. The Spanish reviewer reads the completed paragraph in context and confirms that the software has not made a new language edit.
The punctuation control remains “ficha,” rather than “ficha ,”. The styled identifier remains AB-41. The two-paragraph fixture retains its paragraph separation. An unrelated item T-42 keeps its existing description and document target.
Follow the correction through an ordinary edit
The editor changes T-41’s second sentence through the normal review process, using a newly approved wording fixture. Publishing it retains the same spacing rule. The team does not rely on a one-time manual correction in the generated page, which would disappear during the next edit.
The handover names the source format, the adapter and the reason internal spacing must survive. It includes the complete paragraph and the punctuation and identifier controls. A future maintainer can evaluate a proposed cleanup function against actual content instead of assuming that every leading or trailing space is redundant.
The completed result is a faithful publishing transformation for the inspected material. It does not establish the accuracy of every future translation or remove the need for suitable language review. It does make that review meaningful: the approved sentence is the sentence the customer can read.
The craft collection website service considers this publishing journey alongside profiles, imagery, document relationships and the organisation’s approved claims.
