LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   html: line continuation for strings (https://www.linuxquestions.org/questions/programming-9/html-line-continuation-for-strings-4175494830/)

stateless 02-13-2014 04:59 PM

html: line continuation for strings
 
In HTML, if you have a really long string, is there a way to break it up into separate lines and keep it as one string? I want to have my HTML code within 80 character width. E.g.:

Code:

<a href="www.example.com/blahblahblahblah/somethingorother/really/long/url/path/goes/here/and/is/way/too/long/index.html">title</a>
Would become

Code:

<a href="www.example.com/blahblahblahblah/somethingorother/really/long/url/\
        path/goes/here/and/is/way/too/long/index.html">title</a>

But I tried that (and some variations) and it didn't work.

jlinkels 02-13-2014 05:14 PM

Did you try without the spaces (or tab) in front of path?

jlinkels

stateless 02-13-2014 06:38 PM

Quote:

Originally Posted by jlinkels (Post 5117187)
Did you try without the spaces (or tab) in front of path?

jlinkels

Yeah, no luck.

dugan 02-14-2014 09:19 AM

Quote:

Originally Posted by stateless (Post 5117179)
In HTML, if you have a really long string, is there a way to break it up into separate lines and keep it as one string?

No.

AnanthaP 02-16-2014 01:39 AM

I think simply hitting return in the text editor is all you need to do since the browser will render only tags like br, p-/p etc as new lines. So to the human (you) it is readable and as you would expect, it makes no difference to the machine (browser).

Note

OK

chrism01 02-18-2014 04:41 AM

Assuming dugan is right, there's nothing to stop you setting wrap as on in your editor; that way it appears ok to you (if not so nicely indented).


All times are GMT -5. The time now is 03:01 AM.