Sublime Forum

How to join lines between html tags?

#1

Hi everybody!
How to join lines between html tags?

Example html:

<table>
<tr>
<td>Some text 11
Some text 12</td>
<td>Some text 21
Some text 22

Some text 23</td>
</tr>
</table>
<p>Somte text 3

another one </p>

I need something like this:

<table>
<tr>
<td>Some text 11 Some text 12</td>
<td>Some text 21 Some text 22 Some text 23</td>
</tr>
</table>
<p>Somte text 3 another one </p>
0 Likes

#2

I guess just run this regex replace multiple times until there is nothing left to replace:

  • Find What: >([^<]+)\n([^<]+)<
  • Replace With: >$1 $2<
1 Like

#3

thanks again)

0 Likes