Temporary Forum Oddities - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: Official Links (https://staging.qb64phoenix.com/forumdisplay.php?fid=16) +--- Forum: Announcements (https://staging.qb64phoenix.com/forumdisplay.php?fid=18) +--- Thread: Temporary Forum Oddities (/showthread.php?tid=1726) |
RE: Temporary Forum Oddities - RhoSigma - 06-23-2023 (06-22-2023, 11:39 PM)TerryRitchie Wrote:(06-22-2023, 05:01 PM)RhoSigma Wrote:Yes, everything is aligned.(06-22-2023, 03:41 PM)TerryRitchie Wrote: Just that nagging slight misalignment. Could you share the original code then (but as attachement .zip, not in a codebox) so I have the original state of alignment to experiment/check with. Because copying from the codebox takes over the misalignment. RE: Temporary Forum Oddities - TerryRitchie - 06-23-2023 (06-23-2023, 06:55 AM)RhoSigma Wrote:Sure, attached below.(06-22-2023, 11:39 PM)TerryRitchie Wrote:(06-22-2023, 05:01 PM)RhoSigma Wrote: That's interresting, that would imply it's already missaligned by the code formatter in the IDE as I only insert bbcode on what the IDE gives me, but you're sure it's well aligned right before you export it?Yes, everything is aligned. RE: Temporary Forum Oddities - RhoSigma - 06-23-2023 (06-23-2023, 01:41 PM)TerryRitchie Wrote:(06-23-2023, 06:55 AM)RhoSigma Wrote:Sure, attached below.(06-22-2023, 11:39 PM)TerryRitchie Wrote: Yes, everything is aligned. Thanks Terry, so my tests show the exports go well aligned from the IDE into the clipboard and remain aligned when pasted into the post. I checked that by pasting the export into this post and then immediately copied it back from here into a text file and compared to the original export. This was my first guess, that the clipboard is messing up things, because the IDE uses ANSI mode for the clipboard while the browser is using UNICODE mode and the clipboard usually autoconverts between both as needed. So that's not the problem, however as soon as you save a post and display it, any multi-space sequence e.g. 0x20202020 is converted to 0xa020a020, hence every 1st space is converted into a non-breaking space. If this already happens while saving the post (i.e. the converted version gets saved in the forum database) or just happens on the fly on a later recalls of the post for display or further edits (i.e. the DB entry would be correct and just wrong recalled) that only @grymmjack can find out. However, why a non-breaking space vs. a regular space causes different alignment is another mystery to me. IMO both should simply display the same width space. RE: Temporary Forum Oddities - grymmjack - 06-24-2023 What I've found guys, is that by pasting and saving the post with source edit mode enabled CTRL-SHIFT-S then paste, then save. It honors whitespace as-is. RE: Temporary Forum Oddities - bplus - 06-24-2023 (06-24-2023, 02:53 PM)grymmjack Wrote: What I've found guys, is that by pasting and saving the post with source edit mode enabled CTRL-SHIFT-S then paste, then save. It honors whitespace as-is. Is that before using the IDE File Export (copy to clipboard) or before pasting clipboard into Forum editor? RE: Temporary Forum Oddities - TerryRitchie - 06-24-2023 Is there any way to have code forum posts preserve all ASCII characters in the 32 to 255 range? For example, often times in my code I'll comment depictions of formulas as ASCII art in my code. I usually embed extended ASCII characters in them for readability. The code box below shows the result of this, versus the picture I included showing what it actually looks like. Code: (Select All) SUB Rotate (vec AS Type_Vector2, angleDeg AS SINGLE, origin AS Type_Vector2) RE: Temporary Forum Oddities - RhoSigma - 06-24-2023 (06-24-2023, 04:45 PM)TerryRitchie Wrote: Is there any way to have code forum posts preserve all ASCII characters in the 32 to 255 range? For example, often times in my code I'll comment depictions of formulas as ASCII art in my code. I usually embed extended ASCII characters in them for readability. The code box below shows the result of this, versus the picture I included showing what it actually looks like. Unfortunately not with Forum codeboxes or Wiki examples. Why? Because the IDE uses ANSI codepages, hence to get all chars displayed correctly in the Forum/Wiki webpages it would require the extended ASCII chars (128-255) to be encoded as UTF-8. That's actually what is done when exporting to a HTML/RTF document, as those are usually not copied back to the IDE. However, doing that for the Forum/Wiki exports would actually display those chars correctly in the browser, but if someone uses the 'Select all' button to copy and paste the examples back into the IDE these UTF chars are not converted back to the IDE codepage representation, i.e. the chars would then be wrong in the IDE and could lead to syntax errors. As the intention of codeboxes/wiki examples is, that people can easily copy/paste the code to try it out, I've waived to the UTF-8 encoding here, but that causes the chars to be displayed wrong in the browser. However, when selected and copied back into the IDE they are right again. RE: Temporary Forum Oddities - RhoSigma - 06-24-2023 (06-24-2023, 02:53 PM)grymmjack Wrote: What I've found guys, is that by pasting and saving the post with source edit mode enabled CTRL-SHIFT-S then paste, then save. It honors whitespace as-is. That's absolutly right, but when you then edit the post and save it again, then it's messed up. RE: Temporary Forum Oddities - bplus - 06-24-2023 (06-24-2023, 07:34 PM)RhoSigma Wrote:(06-24-2023, 02:53 PM)grymmjack Wrote: What I've found guys, is that by pasting and saving the post with source edit mode enabled CTRL-SHIFT-S then paste, then save. It honors whitespace as-is. It seemed to work with my _Hypot code post, all the lines ended just right! I had edited out the first code post to try Ctrl+Shift+S. https://staging.qb64phoenix.com/showthread.php?tid=1782&pid=17129#pid17129 RE: Temporary Forum Oddities - RhoSigma - 06-24-2023 (06-24-2023, 09:29 PM)bplus Wrote:(06-24-2023, 07:34 PM)RhoSigma Wrote:(06-24-2023, 02:53 PM)grymmjack Wrote: What I've found guys, is that by pasting and saving the post with source edit mode enabled CTRL-SHIFT-S then paste, then save. It honors whitespace as-is. Ok, and what happens if you edit the post not touching the codebox, but just changing something in the regular post text and then save again? That's what caused me misalignment in the code. |