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
#1
Just noticed that codebox seems to be parsing things into special characters.

I just entered "open_parenthesis + lowercase_c + close_parenthesis" and it becomes this © regardless of if it is in a code box or not. 

Also it seems impossible to paste code from a code box in another post into a new thread without getting unwanted formatting.

For instance if I take this from another post and try to copy it:
def foo(bar):
    print("Hello")
I get two code boxes each with one line.  Removing formatting doesn't help as then I have a bunch of unwanted code tags to remove.
Reply
#2
Quote:I get two code boxes each with one line.  Removing formatting doesn't help as then I have a bunch of unwanted code tags to remove.
I assume you are referring to this?
I get this all the time. Surprisingly not this time with your code here....but most of the time. The only options are to put it into the quick reply, instead of the advanced reply, or put it in a text editor to copy from :huh: . For some reason it doesnt do that in quick reply. I still have no idea whatsoever why this does that...nor how to fix it.

Ill check on the copyright symbol. Ive had this problem before where the default smilies code interferes with code and inputs an image in the code...then the syntax highlighter does not know how to handle it, and inserts an img html tag in its place of that.
Recommended Tutorials:
Reply
#3
Quote:I assume you are referring to this?
Yes, exactly that. Very annoying.
Quote:Ive had this problem before where the default smilies code interferes with code and inputs an image in the code
Yeah, I tried turning smilies off to see if it helped but no luck.
Reply
#4
Thats why i was suggesting to bring back the original default code box. Though it has no sntax highlighter...it doesnt have problems like this.
Recommended Tutorials:
Reply
#5
actually i know exactly what is causing it...dont know the fix though
Quote:<td class="code">
                <div class="container"><div class="line number1 index0 alt2"><code class="python keyword">def</code> <code class="python plain">foo(bar):</code></div><div class="line number2 index1 alt1"><code class="python spaces">&nbsp;&nbsp;&nbsp; </code><code class="python functions">print</code><code class="python plain">(</code><code class="python string">"Hello"</code><code class="python plain">)</code></div></div>
              </td>
its for some reason copying the html code tags along with the text
Recommended Tutorials:
Reply
#6
It's because of our habits. Instead using CTRL+SHIFT+V to paste as plain text, we use CTRL+V, which causes the problem.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#7
the copyright problem is gone. There were some others that i removed as well
Quote:            //$standard_mycode['copy']['regex'] = "#\(c\)#i";
            //$standard_mycode['copy']['replacement'] = "&copy;";

            //$standard_mycode['tm']['regex'] = "#\(tm\)#i";
            //$standard_mycode['tm']['replacement'] = "™";
            
            //$standard_mycode['reg']['regex'] = "#\(r\)#i";
            //$standard_mycode['reg']['replacement'] = "&reg;";

©

®

Quote: Instead using CTRL+SHIFT+V to paste as plain text
This doesnt seem to anything for me at all in chrome. Also I wouldnt want to reply on a keyboard shortcut as most new users copy or paste with their mouse.
Recommended Tutorials:
Reply
#8
Hmm! I am running Iron right now and this is the shortcut for "paste as plain text". Since it is based on Chromium like Google Chrome it should have similar functionality. I know this is not a rule but...
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#9
Quote:Also it seems impossible to paste code from a code box in another post into a new thread without getting unwanted formatting.
No,there a solution that solve it all,this from copy from other codebox or copy code from web.
First i have not had any problem copy from new syntaxHighlighter codebox to other thread.
You know that you can double-click on code to selcet all,then copy and add new code box.
This is my copy from other code box in post,no clean up.
def foo(bar):
   print("Hello")
Just copy from old forum and paste.
[color=#2e8b57][size=x-small][font=Monaco,]class File:[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]  def __init__(self, name):[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]    self.name = name[/font][/size][/color]

[color=#2e8b57][size=x-small][font=Monaco,]class Folder(File):[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]  def __init__(self, name):[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]    super().__init__(name)[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]    self.children = [][/font][/size][/color]
Now with the magic button push in view source(ctrl+shif+s)
This is the exact same paste with 1 difference this example is view source(ctrl+shif+s) push in.
class File:
 def __init__(self, name):
   self.name = name

class Folder(File):
 def __init__(self, name):
   super().__init__(name)
   self.children = []
There also a Remove formatting button this work when not view source(ctrl+shif+s) is push in.
It would have removed all formatting so it look like second example.

I gone write some more about this stuff,because this can be hard to figure out :s!
Reply
#10
(Oct-12-2016, 09:10 PM)snippsat Wrote:
Quote:Also it seems impossible to paste code from a code box in another post into a new thread without getting unwanted formatting.
No,there a solution that solve it all,this from copy from other codebox or copy code from web.
First i have not had any problem copy from new syntaxHighlighter codebox to other thread.
You know that you can double-click on code to selcet all,then copy and add new code box.
This is my copy from other code box in post,no clean up.
def foo(bar):
   print("Hello")
Just copy from old forum and paste.
[color=#2e8b57][size=x-small][font=Monaco,]class File:[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]  def __init__(self, name):[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]    self.name = name[/font][/size][/color]

[color=#2e8b57][size=x-small][font=Monaco,]class Folder(File):[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]  def __init__(self, name):[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]    super().__init__(name)[/font][/size][/color]
[color=#2e8b57][size=x-small][font=Monaco,]    self.children = [][/font][/size][/color]
Now with the magic button push in view source(ctrl+shif+s)
This is the exact same paste with 1 difference this example is view source(ctrl+shif+s) push in.
class File:
 def __init__(self, name):
   self.name = name

class Folder(File):
 def __init__(self, name):
   super().__init__(name)
   self.children = []
There also a Remove formatting button this work when not view source(ctrl+shif+s) is push in.
It would have removed all formatting so it look like second example.

I gone write some more about this stuff,because this can be hard to figure out :s!


This is what i get......when i do that

class
File
:
 
def
__init__(
self
, name):
   
self
.name 
=
name
 
class
Folder(
File
):
 
def
__init__(
self
, name):
   
super
().__init__(name)
   
self
.children 
=
[]
The remove formatting removes text styles...but does not remove code tags. Copying copies the code tags as well.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  codebox usage help doc metulburr 0 1,661 Oct-31-2020, 12:12 PM
Last Post: metulburr
  single/double quote escapes codebox highlighter metulburr 3 3,516 Aug-08-2017, 01:36 PM
Last Post: metulburr
  codebox borders metulburr 15 15,900 Nov-24-2016, 04:04 AM
Last Post: snippsat
  URL not showing properly in comments of codebox Larz60+ 4 5,531 Nov-05-2016, 04:23 PM
Last Post: Larz60+
  Syntax Highlighter Codebox Issues metulburr 38 28,217 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