• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
Oct 31, 2018 Oct 31, 2018

Copy link to clipboard

Copied

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:

Screen Shot 2018-10-31 at 12.15.11 PM.png

Formatted, what I'm looking to achieve:

Screen Shot 2018-10-31 at 12.15.28 PM.png

Views

445

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 31, 2018 Oct 31, 2018

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

Votes

Translate

Translate
Community Expert ,
Oct 31, 2018 Oct 31, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 06, 2018 Nov 06, 2018

Copy link to clipboard

Copied

LATEST

you're welcome

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2018 Oct 31, 2018

Copy link to clipboard

Copied

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\

CC-localsite.jpg

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

CC-StarterPageAssets.jpg

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 31, 2018 Oct 31, 2018

Copy link to clipboard

Copied

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

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 31, 2018 Oct 31, 2018

Copy link to clipboard

Copied

The naming's on purpose. I used Mac's batch renaming -> format feature.

I don't intend to make this a website. This is just for personal use.

Thank you, though.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

kristys71903467  wrote

I don't intend to make this a website. This is just for personal use.

Regardless of whether this is going "live" or not, URLs should not have spaces in them.  The spaces should be replaced (both folders and files) with either an underscore _ or %20.  Funky things can happen.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 31, 2018 Oct 31, 2018

Copy link to clipboard

Copied

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

Paul-M - Community Expert

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines