Python Forum
Poll: Bring back the original codebox?
You do not have permission to vote in this poll.
Bring back the original codebox and let users choose whether they want default codebox (simpler) or use the syntax highlighted codebox
20.00%
1 20.00%
Keep only the syntax highlighted code box
60.00%
3 60.00%
Keep only the default original codebox
20.00%
1 20.00%
Total 5 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More codebox issues
#11
if we cant figure it out how do we expect new users that dont understand BBCode and how to put code between two tags to figure it out?
Recommended Tutorials:
Reply
#12
The plugin has to somehow strip down the formatting code once is pasted. As I saw it, it's everything with <></> before apply its formatting tags.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#13
This syntax highlighter code box i swear is wonky. It seems to do different things at different times. Before Control + Shift + V did not work...now its working...I know it wont work again tomorrow.


class File:
 def __init__(self, name):
   self.name = name
 
class Folder(File):
 def __init__(self, name):
   super().__init__(name)
   self.children = []
I still find this to be too much of a complicated process for the average person without experience on a computer that normally comes here. Normally posting in a forum editor removes formatting automatically. MYBB does not. And with our code syntax box exploits this problem even more. 

So now we have to tell new users to put code in code tags (which was already hard enough) AND have them remove their formatting AND explain that process if they mucked it up like i do.   :wall: or do it ourselves...which leads to more work for us. AT some point it will get old.
Recommended Tutorials:
Reply
#14
How about this? It should work. More information.

Actually, CTRL+SHIFT+V should be browser specific.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#15
(Oct-13-2016, 01:15 AM)wavic Wrote: How about this? It should work. More information.

Actually, CTRL+SHIFT+V should be browser specific.

The first does not work. At least not as expected
I added that then the code is
<pre class="brush: python">valid</pre><br><pre class="brush: python">=</pre><br><pre class="brush: python">"1234567890"</pre><br><pre class="brush: python">some stuff (flushing rangefinder, read RF data, etc)</pre><br><pre class="brush: python">data2</pre><br><pre class="brush: python">=</pre><br><pre class="brush: python">self</pre><br><pre class="brush: python">.RF.readline()          </pre><br><pre class="brush: python"># read the rangefinder</pre><br><pre class="brush: python">Rnge2 </pre><br><pre class="brush: python">=</pre><br><br><pre class="brush: python">str</pre><br><pre class="brush: python">(data2)[</pre><br><pre class="brush: python">str</pre><br><pre class="brush: python">(data2).index(</pre><br><pre class="brush: python">'R'</pre><br><pre class="brush: python">)</pre><br><pre class="brush: python">+</pre><br><pre class="brush: python">1</pre><br><pre class="brush: python">:</pre><br><pre class="brush: python">str</pre><br><pre class="brush: python">(data2).index(</pre><br><pre class="brush: python">'R'</pre><br><pre class="brush: python">)</pre><br><pre class="brush: python">+</pre><br><pre class="brush: python">5</pre><br><pre class="brush: python">] </pre><br><pre class="brush: python">#strips down to 4 numbers</pre><br><pre class="brush: python">Rnge2 </pre><br><pre class="brush: python">=</pre><br><br><pre class="brush: python">Rnge2.replace(</pre><br><pre class="brush: python">"'"</pre><br><pre class="brush: python">,"")  </pre><br><pre class="brush: python">#removes any single quotes</pre><br><pre class="brush: python">while</pre><br><br><pre class="brush: python">True</pre><br><pre class="brush: python">:</pre><br><pre class="brush: python">    </pre><br><pre class="brush: python">if</pre><br><br><pre class="brush: python">not</pre><br><br><pre class="brush: python">set</pre><br><pre class="brush: python">(Rnge2).issubset(valid):      </pre><br><pre class="brush: python">#check for invalid chars - S/B only numerics</pre><br><pre class="brush: python">            </pre><br><pre class="brush: python">Rnge </pre><br><pre class="brush: python">=</pre><br><br><pre class="brush: python">'9000'</pre><br><pre class="brush: python">            </pre><br><pre class="brush: python">break</pre><br><pre class="brush: python">    </pre><br><pre class="brush: python">if</pre><br><br><pre class="brush: python">Rnge2 </pre><br><pre class="brush: python">=</pre><br><pre class="brush: python">=</pre><br><br><pre class="brush: python">'</pre><br><pre class="brush: python">' :             #issubset won'</pre><br><pre class="brush: python">t catch this</pre><br><pre class="brush: python">            </pre><br><pre class="brush: python">Rnge </pre><br><pre class="brush: python">=</pre><br><br><pre class="brush: python">'9000'</pre><br><pre class="brush: python">            </pre><br><pre class="brush: python">break</pre><br><pre class="brush: python">    </pre><br><pre class="brush: python">if</pre><br><br><pre class="brush: python">int</pre><br><pre class="brush: python">(Rnge2) > </pre><br><pre class="brush: python">1000</pre><br><br><pre class="brush: python">:          </pre><br><pre class="brush: python">#I get the error here</pre><br><pre class="brush: python">            </pre><br><pre class="brush: python">Rnge </pre><br><pre class="brush: python">=</pre><br><br><pre class="brush: python">'9000'</pre>
when it should be this
valid="1234567890"
some stuff (flushing rangefinder, read RF data, etc)
data2=self.RF.readline()          # read the rangefinder
Rnge2 = str(data2)[str(data2).index('R')+1:str(data2).index('R')+5] #strips down to 4 numbers
Rnge2 = Rnge2.replace("'","")  #removes any single quotes
while True:
    if not set(Rnge2).issubset(valid):      #check for invalid chars - S/B only numerics
            Rnge = '9000'
            break
    if Rnge2 == '' :             #issubset won't catch this
            Rnge = '9000'
            break
    if int(Rnge2) > 1000 :          #I get the error here
            Rnge = '9000'
Recommended Tutorials:
Reply
#16
i never use CTRL+SHIFT+V or CTRL+V.  but, then, i use Ubuntu Linux, and a 3-button mouse so i don't need to.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#17
(Oct-13-2016, 03:39 AM)metulburr Wrote: The first does not work. At least not as expected
I added that then the code is
I posted it as a hint not as a solution. I don't know PHP.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#18
(Oct-13-2016, 12:10 AM)metulburr Wrote: if we cant figure it out how do we expect new users that dont understand BBCode and how to put code between two tags to figure it out?
There are some new user that dos get it right at first try.

I think there are some difference how MyBB handle this on different OS and browsers.
That not easy to fix,but most should figure out a way that work theme it not so long time.

If not View Source or Remove Formatting button works,
Just copy code into a plain text editor and that into forum.
That what i used before i did know about dos buttons.  
Quote:And with our code syntax box exploits this problem even more.
I have not have any problem with it,when using it myself or fixing others code box.
Seems that new user(that use code tag) usually get it right.
Reply
#19
I like the new syntax highlighting. Would hate to loose it again so quickly. Vote for keeping and reviewing later.

Yes, there are complicated ways to fix the issue while posting copied text, but maybe we find easier solutions as well. I already saw some mentioned in this thread, but did not yet have time to test them thoroughly.
Reply
#20
Quote:I like the new syntax highlighting. Would hate to loose it again so quickly. Vote for keeping and reviewing later.

i wasnt suggesting to remove it. I was more suggesting to have the default code box if there were a lot of problems/ and or people not being able to figure out posting code and the issues with it.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  codebox usage help doc metulburr 0 1,673 Oct-31-2020, 12:12 PM
Last Post: metulburr
  single/double quote escapes codebox highlighter metulburr 3 3,528 Aug-08-2017, 01:36 PM
Last Post: metulburr
  codebox borders metulburr 15 15,928 Nov-24-2016, 04:04 AM
Last Post: snippsat
  URL not showing properly in comments of codebox Larz60+ 4 5,555 Nov-05-2016, 04:23 PM
Last Post: Larz60+
  Syntax Highlighter Codebox Issues metulburr 38 28,345 Oct-06-2016, 01:06 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020