ZHAOF17 / syntaxhighlighter

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

not displaying code when tabbing bad #78

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write code that looks like the bad_php.html file I have attached
2. View file in firefox 3 beta 5 on ubuntu

What is the expected output? What do you see instead?
At the very least the incorrectly tabbed line should not have
non-whitespace chars removed.

What version of the product are you using? On what operating system?
Latest (downloaded ~1 hour ago). Ubunut 8.04 (Linux)

Please provide any additional information below.
I've spend a fair while debugging this and I think it's possibly a firefox
bug... in the function dp.sh.Highlighter.prototype.Highlight.Unindent(str)
pattern switches are set to 'g' causing firefox to not use the regex as
expected. Changing it to 'm' (for multiline mode) fixes the issue.

Also as a side issue I think the whole function if the regexp is allowed to
the "non-zero whitespace check" rather than searching for 0 or more and
then testing for not 0 later in javascript.

I've attached a second file "new_Unindent_Function.js" that has what I
think the function should look like.

Oh btw, I did search for this issue but found nothing.

Original issue reported on code.google.com by neerol...@gmail.com on 29 May 2008 at 12:12

Attachments:

GoogleCodeExporter commented 8 years ago
I'm tired and should go to bed, but I meant to say that I think the function 
would be
more efficient if the non-zero whitespace check was moved into the regexp.

Also sorry if my JS terminology is wrong, I'm a PHP coder by trade.

Original comment by neerol...@gmail.com on 29 May 2008 at 12:17