Possible bug - text formatting problem after GWD reformats code.

164 views
Skip to first unread message

Erin Lillis

unread,
Dec 10, 2015, 3:33:00 PM12/10/15
to Google Web Designer beta

This appears to be a bug.


I'm starting with this:

<div class= tag-line-collapgsed" id="tagline">THIS IS TEXT<br>BROKEN UP<br>FOR DRAMATIC<br> PAUSE</div


This is the CSS which should result in text that is all right aligned.  (See example: http://codepen.io/anon/pen/WrvgKQ)

.tag-line-collapsed {
      position
: absolute;
      text
-align: right;
      left
: 129px;
      top
: 18px;
      width
: 147px;
      font
-size: 15px;
      line
-height: 120%;
      color
: red;
   
}



But after a switch between Design View and Code View, a Preview or a Publish - GWD rewrites that code which is adding whitespace to the end of each line. The whitespace is then interpreted differently by the browsers and in some cases the text the three lines followed by the < br > are pushed to the left one character.


<div class="tag-line-collapsed" id="tag-line-resolve">THIS IS TEXT
           
<br>BROKEN UP
           
<br>FOR DRAMATIC
           
<br>PAUSE</div>








Message has been deleted

Erin Lillis

unread,
Dec 10, 2015, 3:40:09 PM12/10/15
to Google Web Designer beta
Correction to the first line of code. This is the real code:

<div class= tag-line-collapsed" id="tagline">THIS IS TEXT<br>BROKEN UP<br>FOR DRAMATIC<br>PAUSE</div>

cl...@avatarlabs.com

unread,
Dec 10, 2015, 3:45:14 PM12/10/15
to Google Web Designer beta
I had this exact issue today. Only real fix is to open the published file and reformat the text. very bothersome indeed.

Erin Lillis

unread,
Dec 10, 2015, 3:45:17 PM12/10/15
to Google Web Designer beta


rika

unread,
Dec 17, 2015, 2:19:30 PM12/17/15
to Google Web Designer beta
Hi Erin,

I was able to reproduce the text reformatting issue.
It seems to happen when you save, close, and reopen the file after editing the code.
Unfortunately, Chrome adds the white space when the text is right aligned and br tag is in front of the text. 
I will log this bug on your behalf.  Sorry for the inconvenience.

Thanks,
Rika
(GWD team)

cl...@avatarlabs.com

unread,
Jan 8, 2016, 7:48:25 PM1/8/16
to Google Web Designer beta
I found a good work around for this yesterday.

by adding "white-space: pre;" to the text containers CSS the problem will go away.

The only note is due to GWD reformatting the the html on line breaks <br/> you will need to crunch down on the "line-height" rule in css also.

"white-space: pre" reads html line breaks as it's typed and ignores white space. However GWD will run this text back together unless you type in <br/>. So now you have double the line breaks desired and can overcome this obstacle via "line-height"

Hope it helps!
- Clayton

Reply all
Reply to author
Forward
0 new messages