Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax Highlighter Codebox Issues
#1
We are testing new code box. This python tag is syntaxhighlighter Version 4.x. which works with a number of langauges.

We converted all original code tags, php tags, etc. to this new python tag. Let us know if you see any problems. 

Current Issues with Syntax Highlighter Codebox:
  • No select all option (you can double click the code to select all)
  • no restriction on length down (For right now you can surround your python code tags with spoiler tags to shorten the code to a link to expand as needed)
  • copy and paste not working correctly (You must paste code as plain text for this codebox to work right CTRL + SHIFT + V or right click "paste as plain text")
  • Sometimes copying from HTML to codebox can add extra things (such as newlines, or switch a link to an <a> tag within the code box (images/links in the code box can break it and post the html instead)
  • hide underscores from within the code box, if it is at the bottom of the box, or a single line (this is only some browsers, and only on the bottom line of the code box)

import os

class Klass:
    '''docstring'''
    def __init__(self):
        self.var = "var"
        pass
sparkz_alot, micseydel, j.crater And 1 others like this post
*Describe the environment in which it occurs.                                    *Describe the symptoms of your problem clearly.
*Describe the research you did to try and understand the problem.      *Describe the goal, not the step. 
*Use meaningful, specific subject headers                                          *Write in clear, grammatical, correctly-spelled language
*Describe the problem's symptoms, not your guesses                         *Describe your problem's symptoms in chronological order
*Describe the diagnostic steps you took to try and pin down the problem yourself.
*Describe any possibly relevant recent changes in your computer or software configuration. 
*Provide a way to reproduce the problem in a controlled environment.
Quote
#2
Rows numeration :) Gooood
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Quote
#3
At the moment, when I use the python button to post this:

while True:
   number = int(input("enter a number between 1 and 10: "))    # Get a number
   if 0 <= number <= 10:
       print("number = ", number)
       # Go back and get another number
   else:
       print("out of range")
       break    # Break out of 'while' loop and continue with next command

print("Done")


i get this

[/font][/size][/color]
[color=#000000][size=small][font=InputMono][color=#000000][size=small][font=InputMono][color=#000080][b]while True[/b][/color]:
    number = [color=#000080]int[/color]([color=#000080]input[/color]([color=#008080][b]"enter a number between 1 and 10: "[/b][/color]))    [color=#808080][i]# Get a number
[/i][/color]    [color=#000080][b]if [/b][/color][color=#0000ff]0 [/color]<= number <= [color=#0000ff]10[/color]:
        [color=#000080]print[/color]([color=#008080][b]"number = "[/b][/color], number)
        [color=#808080][i]# Go back and get another number
[/i][/color]    [color=#000080][b]else[/b][/color]:
        [color=#000080]print[/color]([color=#008080][b]"out of range"[/b][/color])
        [color=#000080][b]break    [/b][/color][color=#808080][i]# Break out of 'while' loop and continue with next command
[/i][/color]
[color=#000080]print[/color]([color=#008080][b]"Done"[/b][/color])[/font][/size][/color][/font][/size][/color]
[color=#000000][size=small][font=InputMono]


In both Chrome and IE. Are you folks still working on this? 

If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.2, freeBSD 11;Python 3.6, IDE: PyCharm 2016 Community Edition
Quote
#4
Where did you copy the code from? For example if you edit your post and select "source" bbcode option you see a ton of text modifcations.

this 
while True:
turns into this
Output:
[color=#000080][size=small][font=InputMono][b]while True[b][font][size][color][color=#000000][size=small][font=InputMono]:[font][size][color]
*Describe the environment in which it occurs.                                    *Describe the symptoms of your problem clearly.
*Describe the research you did to try and understand the problem.      *Describe the goal, not the step. 
*Use meaningful, specific subject headers                                          *Write in clear, grammatical, correctly-spelled language
*Describe the problem's symptoms, not your guesses                         *Describe your problem's symptoms in chronological order
*Describe the diagnostic steps you took to try and pin down the problem yourself.
*Describe any possibly relevant recent changes in your computer or software configuration. 
*Provide a way to reproduce the problem in a controlled environment.
Quote
#5
Quote:In both Chrome and IE. Are you folks still working on this?
It's a feature of MyBB to auto detect tag,so not sure if it's so easy fix.
Just copy from plain text editor and then post code.
There also a view source button far right in sceditor(ctrl+shif+s).

We are just happy to get syntaxhighlighter V4 to work.
I has been a little bumpy road,i have run V4 local and Flask all ok.
Then try to run it on server MyBB,but there where trouble with <br> tag.
metulburr did a really nice last fix,and the it all worked :)

So now we are running on Default theme which fit the forum fine.
There are also darker themes,but dos not fit forum so well.
Also Python inspired as Django theme.
İmage
Quote
#6
(Oct-04-2016, 04:09 PM)metulburr Wrote: Where did you copy the code from? For example if you edit your post and select "source" bbcode option you see a ton of text modifcations.

this 
while True:
turns into this
Output:
[color=#000080][size=small][font=InputMono][b]while True[b][font][size][color][color=#000000][size=small][font=InputMono]:[font][size][color]

Copied it from pycharm

Moved it to notepad++, lets see:

while True:
    number = int(input("enter a number between 1 and 10: "))    # Get a number
    if 0 <= number <= 10:
        print("number = ", number)
        # Go back and get another number
    else:
        print("out of range")
        break    # Break out of 'while' loop and continue with next command

print("Done")

If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.2, freeBSD 11;Python 3.6, IDE: PyCharm 2016 Community Edition
Quote
#7
snippsat
Quote:Copied it from pycharm
apparently pycharm uses inherited BBCode to highlight their text, in which MyBB interprets back into the editor??
*Describe the environment in which it occurs.                                    *Describe the symptoms of your problem clearly.
*Describe the research you did to try and understand the problem.      *Describe the goal, not the step. 
*Use meaningful, specific subject headers                                          *Write in clear, grammatical, correctly-spelled language
*Describe the problem's symptoms, not your guesses                         *Describe your problem's symptoms in chronological order
*Describe the diagnostic steps you took to try and pin down the problem yourself.
*Describe any possibly relevant recent changes in your computer or software configuration. 
*Provide a way to reproduce the problem in a controlled environment.
Quote
#8
OK, a problem with pycharm? just mine? any other ide's have a problem?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.2, freeBSD 11;Python 3.6, IDE: PyCharm 2016 Community Edition
Quote
#9
Quote:a problem with pycharm?
apparently so

Quote: any other ide's have a problem?
I only use Vim and Geany, neither have this problem.
*Describe the environment in which it occurs.                                    *Describe the symptoms of your problem clearly.
*Describe the research you did to try and understand the problem.      *Describe the goal, not the step. 
*Use meaningful, specific subject headers                                          *Write in clear, grammatical, correctly-spelled language
*Describe the problem's symptoms, not your guesses                         *Describe your problem's symptoms in chronological order
*Describe the diagnostic steps you took to try and pin down the problem yourself.
*Describe any possibly relevant recent changes in your computer or software configuration. 
*Provide a way to reproduce the problem in a controlled environment.
Quote
#10
(Oct-04-2016, 04:31 PM)sparkz_alot Wrote: OK, a problem with pycharm?
No problem for me when i copy direct from PyCharm.
Have you copied code from net into PyCharm?
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  codebox borders metulburr 15 685 Nov-24-2016, 04:04 AM
Last Post: snippsat
  URL not showing properly in comments of codebox Larz60+ 4 280 Nov-05-2016, 04:23 PM
Last Post: Larz60+
  More codebox issues Mekire 26 1,314 Oct-13-2016, 05:20 PM
Last Post: wavic
  Registration issues Kebap 2 253 Oct-11-2016, 10:45 AM
Last Post: Kebap

Forum Jump:


Users browsing this thread: 1 Guest(s)