Forum Moderators: DixonJones

Message Too Old, No Replies

Truncated text in html

squished text in html

         

springfieldoh

10:38 pm on Dec 23, 2018 (gmt 0)

5+ Year Member



In child-like terms, what's the best way to deal with what appears to be truncated text within html?

The problems started using deprecated kompozer, then I went trotting off to bluegriffon and now I'm going back to the basics with a simple sed or xed editor because the code became so ridiculously messy.

The problem is that some of the pages are so outrageous that it would take eons to clean up. For instance there's a slew of lines with only one or two words and those words are tossed at random within the line (so I have a ton of whitespace).

Tidy doesn't seem to work for me. Is there any other ideas short of rewriting each and every page?

tangor

11:38 pm on Dec 23, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can fight it at the code level, or you can view it in a browser (provided the file displays properly), copy that text and then paste it into a replacement file (no tags involved) and start over. Or you can use any html handy word processor to open and then save as plain text and do the same thing. Sometimes magic bullets are pretty simple. :)

BTW, welcome to Webmasterworld!

lucy24

11:47 pm on Dec 23, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



For instance there's a slew of lines with only one or two words and those words are tossed at random within the line (so I have a ton of whitespace).
How about a text editor that does global replace on multiple files?
"  +" >> " "
or even
"\s\s+" >> " "
depending on how brave you feel.

tangor

1:28 am on Dec 24, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Even then, work with backups! :)

springfieldoh

5:27 am on Dec 24, 2018 (gmt 0)

5+ Year Member



LOL....okay it's conclusive then.....shheesh, how does this stuff happen (i'm old now but what will the html look like when I'm old-er?!).

I like the advice to edit an archived backup.....there's even a possibility that an untainted page will be located. Sure seems like a lot of work any way I look at it though.

Thanks for the responses

phranque

5:37 am on Dec 24, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



sounds like a job for awk?

springfieldoh

5:45 am on Dec 24, 2018 (gmt 0)

5+ Year Member



lucy24: The net reveals all sorts of stuff just like what you posted. However I am unsure where to paste that (doesn't do a thing in terminal and using xed and replace doesn't find anything).
Sorry but I'm totally new and tip-toeing around the whole html and code thing

lucy24

6:33 am on Dec 24, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I won't touch Terminal with a barge pole, but does that mean you're on a Mac? If so, TextWrangler (the free version of BBEdit) will do multi-file global replaces using regular expressions. But if it isn't a vast number of files, it is definitely less alarming to open them one at a time so you can look at the result. And always remember: Unlmited Undo is your very, very good friend.

Edit: I think I once tried Tidy, years ago, and the results were so disastrous I’ve had nothing to do with it ever since.

springfieldoh

6:38 am on Dec 24, 2018 (gmt 0)

5+ Year Member



lucy24: LOL I too! Tidy not only planted links to itself in each of the files which is easily removed thanks to (terminal) and only a couple of days ago did I consider trying it again (luckily god had me not so motivated).

p.s. I would never work with a mac. I love linux too much.

lucy24

7:01 am on Dec 24, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well, I'm sure there is a good comprehensive text editor for linux too.

phranque

8:25 am on Dec 24, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I'm sure there is a good comprehensive text editor for linux

indeed:
vi|sed|awk|emacs