Page 1 of 1
Tidying up Text Editor content - any easy way?
Posted: Wed May 07, 2025 2:12 am
by ChoccieMuffin
Hi all. In some of my topics, when I look at them in the Text Editor, they're neatly laid out, making them easy to follow, so something like this (the underline isn't there, it's just to show the spacing):
<p>This is a paragraph</p>
<ul>
___<li>This is a list.</li>
</ul>
etc
But in some topics, for some reason things are all squished up:
<p>This is a paragraph</p><ul><li>This is a list.</li></ul>
Is there any way I can get a topic that's been squished to be more legible in a text editor? It's a very small thing, but would be nice.
Answers on a postcard please!
Re: Tidying up Text Editor content - any easy way?
Posted: Wed May 07, 2025 9:37 am
by paul_collins
I normally see that where you have nested lists. To make it display over separate lines you need to ensure the parent list item is enclosed in <p> tags, for example:
Code: Select all
<li>
<p>parent item:</p>
<ul>
<li>sublist</li>
</ul>
</li>
without the paragraph tags you'll see it as:
Code: Select all
<li>parent item:<ul><li>sublist</li></ul></li>
It also makes it far easier to see the wood from the trees when looking at changes in a version control system.
Re: Tidying up Text Editor content - any easy way?
Posted: Thu May 08, 2025 1:13 am
by ChoccieMuffin
Thanks, paul_collins, but I disagree with your suggestion that having <p>s inside <li>s would fix it, because I have lots of topics where the lists are displayed beautifully in the Text Editor window without having <p>s inside them. And it's not just lists, it's everything, even in topics that don't contain any lists, so I think your suggestion is a dead end. But thanks for responding! I have been tidying up lists a bit anyhow, but once the topic is displaying all squished up, even editing the lists as you suggest doesn't fix the display problem.
Given that's what my topics look like now, is there anything I can do (a find-and-replace, open in some other application, something else?) that I can do so that the linefeeds appear again?
Re: Tidying up Text Editor content - any easy way?
Posted: Thu May 08, 2025 7:41 am
by AlexFox
You could probably use some regex to insert a line break at the end of certain closing tags, but this seems like it would be arduous. When I see this happen it's usually because something has removed the existing line break characters, I've never been able to consistently replicate it though.
Edit: Also you can just open the topic in something like VS Code and right click and format document
