inherit
96289
0
May 17, 2020 9:37:00 GMT -8
elli
1,822
January 2007
ebbymac
|
Post by elli on Dec 27, 2017 17:53:33 GMT -8
Forum URL: support.proboards.com/post/7082782/threadLately, it seems that the code tag has been stripping whitespace -- both from indents, and empty lines -- which makes everything look like a jumbled mess. Any ideas why?
|
|
Kami
Forum Cat
Posts: 40,063
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,063
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Dec 27, 2017 22:57:02 GMT -8
Forum URL: support.proboards.com/post/7082782/threadLately, it seems that the code tag has been stripping whitespace -- both from indents, and empty lines -- which makes everything look like a jumbled mess. Any ideas why? I feel like there was a similar problem before, where the code tag stripped any indentation (though not empty lines) that Chris addressed. I can't seem to find the post, but I feel like this was something that happened previously, as Brian linked to an old post of mine on wayback machine from like, 2010 and it was like that too.
|
|
inherit
Official Code Helper
65613
0
1
May 11, 2024 14:19:23 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,879
December 2005
horace
|
Post by Chris on Dec 28, 2017 4:23:37 GMT -8
There was a change made a few weeks ago that had the undesired effect (at least for people wishing to post formatted code) of condensing sequential white-spaces in code tags the way HTML says it should be condensed for most markups. This occurred at the same time that the code tag got new data-root-container and data-content-container attributes and it was a fairly recent change since this post dated 7-Sept had all the code examples properly indented and looking all fancy and now look like hieroglyphics chiseled by foot. I've since taken up knitting to while the time away since posting code is no longer enjoyable, I'm currently working on a cover for my F-150 for those extra cold spells Use the [ pre] tag or div with the "white-space:pre" style to post pretty printed code. Be warned that applying "white-space:pre" to the code tag itself is pointless since the whitespace has been destructively converted prior to being rendered in your browser (try it and see that you get only one space back where there used to be four indented tabs or fixed space for example)
|
|
inherit
96289
0
May 17, 2020 9:37:00 GMT -8
elli
1,822
January 2007
ebbymac
|
Post by elli on Dec 28, 2017 13:57:21 GMT -8
Chris Was this a ProBoards change or browser engine change? (If you know) Thank you for the tip. The BBC [*pre] tag worked. <!DOCTYPE html> <html lang="en-us"> <head>
<title>Some HTML to Test With</title>
</head> <body>
<header> <div id="banner" role="banner"> <h2>Title</h2> </div> </header>
</body> </html>
|
|
inherit
Official Code Helper
65613
0
1
May 11, 2024 14:19:23 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,879
December 2005
horace
|
Post by Chris on Dec 28, 2017 15:31:16 GMT -8
The presence of the data attributes implied this was a change on Proboards' end, plus it is very rare that all major browsers suddenly agree to change a behaviour in such precise unison that it would make an olympic synchronised swimming team envious.
One caveat when using this alternate method to post pretty code is that you no longer get the benefit the code tag providesd which is the prevention of things that may appear to be bbcode getting parsed so you must now take care to either inspect your code once rendered in preview to ensure that the [i] and [b] in 2 === b && (allthat[i] = can[b]) doesn't accidentally italicise and bold the rest of your code and in the process ruin the code for copy/paste as it was back in the v3/v4 days or be sure to add [noubbc] or the V5 version [noparse] around the code (but within the [pre]) to nullify any such mistaken identities.
ETA: The cynic in me keeps whispering this may have an ulterior motive of steering people away from posting code in order to foster the habit of creating plugins that contain code (even the smallest) so the user doesn't necessarily have to interact with any codes directly (or was that the paranoid schizo, ugh all these voices it's so hard to tell them apart nowadays) ...but then how would one <span title="unless importing templates through pbt files is also encouraged or single templates through file transfer (*.spbt <chuckle>) is now a thing">instruct on modifying templates</span> so hush you two!
ETA2: an interesting thought, a plugin that would turn any posted code into a downloadable plugin via blob api
|
|