Python Forum
More codebox issues - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Board (https://python-forum.io/forum-26.html)
+--- Thread: More codebox issues (/thread-455.html)

Pages: 1 2 3


More codebox issues - Mekire - Oct-12-2016

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.


RE: More codebox issues - metulburr - Oct-12-2016

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.


RE: More codebox issues - Mekire - Oct-12-2016

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.


RE: More codebox issues - metulburr - Oct-12-2016

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.


RE: More codebox issues - metulburr - Oct-12-2016

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


RE: More codebox issues - wavic - Oct-12-2016

It's because of our habits. Instead using CTRL+SHIFT+V to paste as plain text, we use CTRL+V, which causes the problem.


RE: More codebox issues - metulburr - Oct-12-2016

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.


RE: More codebox issues - wavic - Oct-12-2016

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...


RE: More codebox issues - snippsat - Oct-12-2016

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!


RE: More codebox issues - metulburr - Oct-13-2016

(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.