Configure the syntax highlighting script to use regular quotes

One small issue with the forums:
When using java tags the syntax highlighter destroys the double quotes of all string literals. Copying code from the forum posts is not possible without editing it…

The forum should be less inclined to eat characters now. Care to test it?

[java]
class TestCase{
public static void main(String[] arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}
[/java]

Its converting the double quote character " into open and close quotes, which are then invalid if cut and pasted into code.

[java]void blah(T x) {
}
[/java]

And its still removing anything inside angle brackets from inside the code blocks.

I have to chime in. Any conversion beyond HTML escaping is evil if you want to paste code.
Things I noticed:

  • Quote conversion
  • Angle bracket removal
  • Smiley insertion does not happen anymore (btw strikethrough is now broken)
    Here’s a test:
    [java]System.out.println(“text”); – Quote conversion
    List ; – Angle bracket removal
    System.out.println(8); – Smiley insertion
    [/java]

Here’s the same in a code block:
System.out.println("<em>emphasis?</em>"); -- Quote conversion and HTML tag interpretation List ; -- Angle bracket removal System.out.println(8); -- Smiley insertion

Every time I see things like this I just shake my head and laugh. Not a hearty and joyful laugh. No.

POS.

It’s a good thing this isn’t a coding forum. :wink:

@pspeed said: It's a good thing this isn't a coding forum. ;)

Let’s not stoke the fire, shall we? :stuck_out_tongue:

Testing broken strikethrough. Testing smiley insertion: :expressionless: :smiley:

Edit: So strikethrough and smiley insertion seems to work just fine to me, but the quotes conversion and the failing angle brackets is a major issue. I’ve reported it.

Bold works when marking some text, then clicking the button.
Italic works when marking some text, then clicking the button.
Underline doesn’t work when marking some text, then clicking the button.
Strikethrough doesn’t work when marking some text, then clicking the strikethrough button.

Smiley insertion always worked for me, including when I didn’t want it (in Java code).

Markup seems to be a mess currently.

Another test.
[java]Java block with angled brackets in it[/java]

Code block with <em>angled brackets</em> in it

Markdown code block with <em>angled brackets</em> in it

I think the problem with angled brackets has been solved. I suspect it was a caching thing. The issue with the “quotations” is still present though. More on that shortly.

What… four different kinds of markup now… (Java, code, html, smileys)
I think I just got my daily dose of My Eyes Glazeth Over ™.

[java]test</em[/java]

``

It still doesn’t work Erlend.

Try putting xml as the open and close tags instead of em. … they get filtered.

Em is only being allowed because its normally allowed formatting.

[xml]System.out.println(“emphasis?”);[/xml]
[java]System.out.println(“emphasis?”);[/java]

System.out.println("<em>emphasis?</em>");

System.out.println(“emphasis?”);
System.out.println("<em>emphasis?</em>");

[xml]
class TestCase{
public static void main(String[] arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}
[/xml]
[java]
class TestCase{
public static void main(String[] arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}
[/java]
[code
class TestCase{
public static void main(String[] arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}
[/code]

class TestCase{
public static void main(String[] arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}

class TestCase{
public static void main(String[] arg){
String testString = "this is a string";

print(&quot;will this work?&quot;);

}
private static void print(String message){
System.out.println(message);
}
}

[xml]<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>[/xml]
[java]<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>[/java]

&lt;note&gt; &lt;to&gt;Tove&lt;/to&gt; &lt;from&gt;Jani&lt;/from&gt; &lt;heading&gt;Reminder&lt;/heading&gt; &lt;body&gt;Don't forget me this weekend!&lt;/body&gt; &lt;/note&gt;
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>

<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>

<cite>@erlend_sh said:</cite> [xml]System.out.println("emphasis?");[/xml] [java]System.out.println("emphasis?");[/java] [code]System.out.println("emphasis?");[/code] System.out.println("emphasis?"); System.out.println("emphasis?");

[xml]
class TestCase{
public static void main(String arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}
[/xml]
[java]
class TestCase{
public static void main(String arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}
[/java]
[code
class TestCase{
public static void main(String arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}
[/code]

class TestCase{
public static void main(String arg){
String testString = “this is a string”;

print("will this work?");

}
private static void print(String message){
System.out.println(message);
}
}

class TestCase{
public static void main(String arg){
String testString = "this is a string";

print(&quot;will this work?&quot;);

}
private static void print(String message){
System.out.println(message);
}
}

[xml]<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>[/xml]
[java]<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>[/java]

&lt;note&gt; &lt;to&gt;Tove&lt;/to&gt; &lt;from&gt;Jani&lt;/from&gt; &lt;heading&gt;Reminder&lt;/heading&gt; &lt;body&gt;Don't forget me this weekend!&lt;/body&gt; &lt;/note&gt;
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don’t forget me this weekend!</body>
</note>

<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

Oooo, that looks promising. :slight_smile:

Still opening and closing quotes though. And it’d be nice if we could kill off the bundled highlighter of this toolbar plugin, the light and dark grey one you get if you use angled brackets code tags.