Skip to main content
Oct 31, 2018 7:23 PM UTC
Answered

How to Batch Insert Specific Line Breaks in Code (View)?

I'd like to insert a line break after <p>, before </p>, and after each <img> tag. Is there a way I could batch insert line breaks in these specific spots?

For example:

Unformatted:

Formatted, what I'm looking to achieve:

This topic is closed to new replies. Start a new post to keep the conversation going.
B i r n o u
B i r n o uCorrect answer
Legend
Oct 31, 2018 8:00 PM UTC

depending if you want to physically add a back return into the code, of if you want to only format the display of the code, you will have to apply different solution

1 if you want to change the code... search and replace using reg exp

search (<p[^+>]*>)|(<\/p>)|(<img[^+>]*>)

replace by $1$2$3<br>

2 if you want to display code format differently

go on edition > bibliotheque de balises...

search for you concerned tag and edit the line retun pop up

8 replies

Legend
Oct 31, 2018 9:32 PM UTC

'bibliotheque de balises.' sounds soooo much better than 'Tag Library Editor'

Translate
Paul-M - Community Expert
Nancy OShea
Community Expert
Community Expert
Oct 31, 2018 8:18 PM UTC

But before you do any of that, please fix the file paths to images and rename images without spaces or special characters.

On the web, this is an invalid file name.

halloween/ 1/ 5.gif

Change it to this without spaces:

halloween/01/05.gif

Judging by the path to file:///Users/Kristy/..... on your computer, I'm guessing you are not working within a defined local site folder.  Or if you are, you have not saved and named your document.  To define a site, go to Site > New Site and give it a name and choose a folder on your hard drive.  For example, C:\MyTestSite\

Image paths should resolve to your site's images folder.

Translate
Nancy O'Shea— Product User & Community Expert
WolfShade
Legend
Oct 31, 2018 8:32 PM UTC

Good eye, Nancy.  I completely glossed over the path/name issues.

V/r,

^ _ ^

Translate
B i r n o u
B i r n o uCorrect answer
Legend
Oct 31, 2018 8:00 PM UTC

depending if you want to physically add a back return into the code, of if you want to only format the display of the code, you will have to apply different solution

1 if you want to change the code... search and replace using reg exp

search (<p[^+>]*>)|(<\/p>)|(<img[^+>]*>)

replace by $1$2$3<br>

2 if you want to display code format differently

go on edition > bibliotheque de balises...

search for you concerned tag and edit the line retun pop up

Translate
Nov 7, 2018 2:44 AM UTC

Thank you!

Translate
B i r n o u
Legend
Nov 7, 2018 5:37 AM UTC

you're welcome

Translate