whitespace inside CODE tag is not preserved
#1
Original Poster
Moderator: Hyatt, American Express; FlyerTalk Evangelist




Join Date: Jun 2015
Location: WAS
Programs: :rolleyes:, DL DM, AA EXP, UA Silver, Hyatt Glob, Mlife Noir (=> Marriott Amb), invol FT beta tester
Posts: 21,634
whitespace inside CODE tag is not preserved
The CODE tag is supposed to be rendered in a monospace font and keep all whitespace intact, intended for use when showing programming source where indentation makes things easier to read (and in a language like Python is actually semantically important), and still useful on non-programming sites like FlyerTalk for showing data in tabular form, maybe with columns of words/numbers aligned, for example:
but if you create a post with aligned text in a CODE block, then you edit the post, then whitespace is deleted and it ends up looking like this:
(this can also be reproduced even without editing an existing post -- start a new post, click "Source" to switch from the WYSIWIG editor into the raw source editor mode, carefully compose a CODE table with specific whitespace layout, and then click "Source" again to go back to the visual mode, it also destroys white space.)
Code:
this this column column is is left right justified justified
Code:
this this column column is is left right justified justified
#3
Original Poster
Moderator: Hyatt, American Express; FlyerTalk Evangelist




Join Date: Jun 2015
Location: WAS
Programs: :rolleyes:, DL DM, AA EXP, UA Silver, Hyatt Glob, Mlife Noir (=> Marriott Amb), invol FT beta tester
Posts: 21,634
I can't replicate something I don't know how to do and need to be able to understand to explain to tech.[/QUOTE]
I clicked on "Source" to enter raw source editing mode, lined it all up, and clicked Post without going back to WYSIWIG mode.
I *think* it works if you post in WYSIWIG mode but it's harder to line things up visually because it's not in a monospace font then.
Trying this out:
they don't look lined up as I'm typing this but there are exactly 3 spaces in between each group of letters, will see how it comes out.
I clicked on "Source" to enter raw source editing mode, lined it all up, and clicked Post without going back to WYSIWIG mode.
I *think* it works if you post in WYSIWIG mode but it's harder to line things up visually because it's not in a monospace font then.
Trying this out:
Code:
abc def ghi jkl mno pqr
#4
Original Poster
Moderator: Hyatt, American Express; FlyerTalk Evangelist




Join Date: Jun 2015
Location: WAS
Programs: :rolleyes:, DL DM, AA EXP, UA Silver, Hyatt Glob, Mlife Noir (=> Marriott Amb), invol FT beta tester
Posts: 21,634
Ok, well not sure why 3 spaces seems to have ballooned to 5 in the first few rows.
But anyway, here's what it looks like, as soon as I click "Edit" (but before clicking or typing anything else):

although that section is rendered in a monospace font, note that all the whitespace has collapsed down to a single space.
(I didn't click "Save" so the whitespace in the previous post is preserved)
Not the most important bug in the world, but it's a hassle if you go back and edit a previous post because of typos or to correct/add info etc. and now you have to line everything up again in the table. I have not verified, but would suspect, that this bug affects wikis as well since it is the same editor?
But anyway, here's what it looks like, as soon as I click "Edit" (but before clicking or typing anything else):

although that section is rendered in a monospace font, note that all the whitespace has collapsed down to a single space.
(I didn't click "Save" so the whitespace in the previous post is preserved)
Not the most important bug in the world, but it's a hassle if you go back and edit a previous post because of typos or to correct/add info etc. and now you have to line everything up again in the table. I have not verified, but would suspect, that this bug affects wikis as well since it is the same editor?
#7
Original Poster
Moderator: Hyatt, American Express; FlyerTalk Evangelist




Join Date: Jun 2015
Location: WAS
Programs: :rolleyes:, DL DM, AA EXP, UA Silver, Hyatt Glob, Mlife Noir (=> Marriott Amb), invol FT beta tester
Posts: 21,634




