Bug 93035

Summary: khtml incorrectly renders tab characters (konqueror and Safari)
Product: [Applications] konqueror Reporter: theosib
Component: khtml parsingAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:

Description theosib 2004-11-10 15:30:10 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    Gentoo Packages
Compiler:          N/A 
OS:                Linux

Look at the source code in thit article page:

http://www.troubleshooters.com/codecorn/primenumbers/primenumbers.htm

In mozilla, the it's formatted correctly.  In konqueror, the indenting of the code is completely random.  It appears that Safari users are having exactly the same problem with this page.

My best guess as to the cause is that there are tab characters embedded in the text, and khtml doesn't like them.
Comment 1 Stephan Kulow 2004-11-10 15:36:58 UTC
very possible
Comment 2 Allan Sandfeld 2005-03-21 20:20:41 UTC
CVS commit by carewolf: 

Fix stupid mixing of PRE, BR and tabulators.
BUG: 93035


  M +3 -1      ChangeLog   1.407
  M +3 -0      html/htmltokenizer.cpp   1.300


--- kdelibs/khtml/ChangeLog  #1.406:1.407
@@ -1,5 +1,7 @@
 2005-03-21  Allan Sandfeld Jensen <kde@carewolf.com>
 
-        * html/htmltokenizer.cpp: Only skip first LF if immediately after PRE tag
+        * html/htmltokenizer.cpp:
+            - Only skip first LF if immediately after PRE tag.
+            - Set prePos to 0 after BR tag
 
 2005-03-18  Allan Sandfeld Jensen <kde@carewolf.com>

--- kdelibs/khtml/html/htmltokenizer.cpp  #1.299:1.300
@@ -1139,4 +1139,7 @@ void HTMLTokenizer::parseTag(TokenizerSt
                 discard = AllDiscard;
                 break;
+            case ID_BR:
+                prePos = 0;
+                break;
             case ID_SCRIPT:
                 if (beginTag) {