bmroberts1987 / syntaxhighlighter

Automatically exported from code.google.com/p/syntaxhighlighter
GNU General Public License v3.0
0 stars 0 forks source link

Problem with unescaped < > in PHP #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Using PHP brush one needs to use entities &lt; &gt;.

It's not a bug, but it would be nice to allow < > & in the code.

The following code does not work as expected:

<pre name="code" class="php">
<?php
$a = 2;
$b = 3;
if ($a > $b) {
    echo 'foo';
}
?>
</pre>

What is the expected output? What do you see instead?

Everything before operator > is unvisible.

What version of the product are you using? On what operating system?

Code Syntax Highlighter Version 1.5.1
WinXP/Firefox 2.0.14

Please provide any additional information below.

Original issue reported on code.google.com by wlodzimi...@gmail.com on 30 Jun 2008 at 10:28

GoogleCodeExporter commented 9 years ago
I have the same issue with < and > chars on my web site. I think, it happens 
because
these symbols may be seen as HTML tags.

As one of the solutions - replace < and > with < and > before output.

Original comment by ilya.alb...@gmail.com on 25 Dec 2008 at 3:35

GoogleCodeExporter commented 9 years ago
they are seen as HTML tags by the browser on page parsing, and there's nothing 
that 
could be done in JS about it. You have to escape those manually unfortunately.

Original comment by alex.gor...@gmail.com on 25 Dec 2008 at 3:43