I saved your sample file as .fodt so that I could analyze the underlying XML.
The <span> mess is already present in the Writer document. As previously mentioned in the comments, this originates in manual character formatting which eventually was replaced to revert to the initial state. Note that replacing an existing formatting with something which looks like the status quo ante is not the same as erasing the formatting. E.g. toggling twice bold is not the same as no bold at all: a markup is kept in the XML.
I selected the whole text and cleared direct formatting (Ctrl
+M
) to remove all added manual formatting. I saved again as .fodt and there was no longer the <span> mess.
This also showed that centering in Header 3 was done with direct formatting instead of customising the paragraph style.
Fix:
-
select your whole document and Ctrl
+M
-
configure your paragraph styles to include all needed properties instead of providing them with direct-formatting
-
create character styles or use existing ones for intra-paragraph typographical variations
-
make sure you don’t use direct formatting unless you have measured the consequences
With such a simple type of document, you shouldn’t need any direct formatting at all, except a special manual break here or there to switch to another page style.
EDIT Recipe to “forward” your present intra-paragraph formatting
What you can do on your original file (before clearing direct formatting) is to navigate to words which are not formatted as per the paragraph style. You’ll see if they are italics or bold. Select the sequence and apply built-in Emphasis for italics or Strong Emphasis for bold. If you need more variants, create the adequate character styles and apply it.
Applied character styles will not be cleared by Ctrl
+M
. Therefore, you should not see any difference when you Ctrl
+M
. Ctrl
+M
acts only on the selection. Consequently if you proceed paragraph after paragraph, this should be quite safe.
Don’t bother for the exact aspect of the styles at this step. The important thing is to mark up your text with styles.
When done, tune the styles, paragraph styles as well as character styles. You’ll see immediately the effect without the pain to track the occurrences. This is why it is important to give styles names reflecting the semantic intent, not the typographical appearance: Emphasis may be italics or red or another font face. Change the style, all occurrences are changed.
This is the magic of style. You separate content from look. This may seem disturbing at first but it is tremendously versatile and powerful. Experiment.
Once your text is styled, pasting paragraphs in another fresh document keeps style marking. No stress.
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!