I believe you encounter the fact that in HTML sequences of white space are collapsed. So in essence a sequence of spaces will be shown as one. This can be behavior can be changed by setting the CSS property that handles the white space of an element.
Paragraph properties
To set this on a single paragraph or element:
Place the cursor in the text.
Control + click and choose Paragraph from the contextual menu (or use Ctrl+E). The Paragraph properties dialog appears.
Click Advanced at the lower left of the dialog.
Enter the white-space property and set its value to pre.
CSS stylesheet
Alternatively set this property in a CSS stylesheet. The following assumes you assigned a class name to the element (in this case thecode).
Open the context_all_styles.css from the Resources panel.
Enter the CSS snippet below.
Save the stylesheet file.
Hope this is of some help,
Erik
.thecode {
white-space: pre;
}
PS. I believe there is an error in the article reference by Dennis. The Whitespace checkbox in the Attributes panel refers to the following feature: PlanetPress Connect 2020.2 User Guide