Jump to content

Tabs in Forum code


Recommended Posts

Hi everybody :)

Let's test 6 lines with 6 columns and @Tab separators (5 @Tabs per line x 6 lines = 30 Tabs)
First a pic to show you how the lines look like in NotePad, perfectly aligned :

1196011498_6lines6cols30Tabs.png.b16e71bbe677323a0627f76bc4404ecc.png

Then I copy-paste the 6 lines in Forum code, below :

7:32    7.36    0   0.011%  162.7   0
7:32    7.36    d   0   0.011%  0
0   7.36    d   0   0.011%  0
0   7.36    d   0   0.011%  55
51:0    7.36    d   0   0.011%  0.001
7:30    0   7.36    d   0   0

Question: are the Tabs on the Forum lost or not, for me and other users ?

* A first test shows that the only way I can access the Tabs again is to be logged, edit my code, copy the lines from the Forum and paste them anywhere : the @Tabs are all there.

* But If I'm not logged anymore, then copying my own code from the Forum and pasting it anywhere transforms the @Tabs into spaces, which is what I would like to avoid.

* Also, If any other user (logged or not) try to copy my code from the Forum, will he lose all the formatting @Tabs ?
I think he will lose them (to be confirmed)

So what's the point of inserting @Tabs in code if noone (except the logged OP) can access them afterwards ?

I'm asking this because everytime I copy a script from someone else on the Forum, then paste it in Scite, all indentations (@Tabs) are lost and replaced with spaces. Same for subject tests prepared with @Tabs by OP and not being copied correctly by other users etc...

Tests done with Chrome. Please advise if there's something incorrect in the preceding explanations, or if there's a way to solve this.
Thanks :)

Link to comment
Share on other sites

43 minutes ago, pixelsearch said:

* Also, If any other user (logged or not) try to copy my code from the Forum, will he lose all the formatting @Tabs ?
I think he will lose them (to be confirmed)

Yes, I have to confirm that the forum editor CKEditor is changing the content to spaces instead of TABs. This is quite usual I guess, because it's web content at the end and without specific tags, such characters will be replaced by   (I would expect).

So I believe, if the author of a post use TABs in a code block of the forum editor, TABs will be lost for everyone 😔 .

Best regards
Sven

Tests with different code, quote, spoiler and combinations of them:
this    is    a    test

this    is  a   test
this    is  a   test
Quote

this    is    a    test

Spoiler

this    is    a    test

Spoiler
this    is  a   test

 

Spoiler
Quote

this    is    a    test

 

<pre>
this    is  a   test
</pre>

 

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

11 hours ago, SOLVE-SMART said:

So I believe, if the author of a post use TABs in a code block of the forum editor, TABs will be lost for everyone

...but not for the author of the post who can retrieve them any time (we'll see how below)

Thanks @SOLVE-SMART for your tests, here is a complete one I did too a few hours ago :

2 lines below were prepared in Scite, with Tab delimiters (only visible because I checked temporarily "WhiteSpace" in Scite View menu). My Scite Tab indentation is 4, because of these lines in SciTEUser.properties

#changed that one permanently (from 3 to 4) on 13 Nov. 2018
indent.size=4
indent.size.*.au3=4

First, here is the image of the 2 lines so you can see all Tab delimiters, even the "little tab" who desperately tries to hide and is placed just after 1234567 , appearing like this > in the pic

433475475_TabcharacterstestforAutoItForum.png.2762acde6cdbd3c65105e05669d18b86.png

Now I'm pasting the same 2 lines below : Tabs are automatically replaced by spaces in the final display and if you copy & paste these 2 lines, you'll notice they don't have any Tabs inside anymore, but spaces.

1234567 123456  12345   1234    123 12  1   
2       3           end

 

11 hours ago, SOLVE-SMART said:

without specific tags, such characters will be replaced by &nbsp; (I would expect).

That's true, here is the part of the Web source page concerning these 2 lines (which were posted in Plain format and not AutoIt format, to get a shorter Browser source code below, it doesn't have an influence on the behavior of Tab chars)

<pre class="geshi geshiprinted lang-text ipsCode">1234567 123456&nbsp; 12345 &nbsp; 1234&nbsp; &nbsp; 123 12&nbsp; 1 &nbsp; 
2 &nbsp; &nbsp; &nbsp; 3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end</pre>

Each [&nbsp; ] without brackets show exactly where the non-breaking space starts and where it ends. I won't discuss each and every replacement of each Tab by space and/or &nbsp or we'll never end this post.

Nevertheless, the fact that, immediately, 1234567 + 1 Tab became 1234567 + 1 normal space is intriguing. Why ?

Because if this Tab has been "lost" forever, how is it possible that the author can login again, enter his own code window, copy back its content from the Forum and paste it anywhere, with all Tabs reappearing correctly ? A single space can't be turned back to a Tab character, can it ?

Only then I realized something was missing and there must be another part of the source code where all the indentation has been saved, so back to work and let's check the source again, bingo !

...\u0026#13;\n1234567\t123456\t12345\t1234\t123\t12\t1\t\u0026#13;\n2\t\t3\t\t\tend\n...

This is what we found much lower in the source, probably javascript + RegEx syntax and we see clearly all \t that will allow the author to retrieve his indented code correctly. So it seems that there is one place in the source corresponding to the web output (for all users, tabs being lost) and a 2nd place in the source with the indented code (only for the author and his code window)

Finally, I checked other Forum source pages (where indented scripts using Tab were present) and all the script codes, with their \t characters, appeared at the bottom of the source pages... in JS + RegEx way.

Edited by pixelsearch
typo
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...