newbie question - ul ol lists

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Mikko2
Posts: 1
Joined: Thu Oct 09, 2008 8:57 am

newbie question - ul ol lists

Post by Mikko2 »

Total newbie question:
Is there a way in Textpad to quickly format lists?

For example if I have
one
two
three
four

and want it to look like this
<ol>
<li>one</li>
<li>two</li>
<li>three</li>
<li>four</li>
</ol>

what would be the quickest way to do it?
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You can create the list elements with
Find what: ^+*$
Replace with: <li>\0</li>

[X] Regular expression

Replace All
How do you know where the lists start and end? If they are always preceded and followed by a blank line, you can insert the opening list tags with
Find what: ^\n<li>
Replace with: \n<ol>\n<li>

[X] Regular expression

Replace All
and insert the closing list tags with
Find what: </li>\n$
Replace with: </li>\n</ol>\n

[X] Regular expression

Replace All
You might record a macro to do all this.
Post Reply