Bug 118453 - "Tools->Format XML Code" action formats XML comments incorrectly
Summary: "Tools->Format XML Code" action formats XML comments incorrectly
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: 3.5
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-16 15:29 UTC by Marte Soliza
Modified: 2020-12-13 00:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marte Soliza 2005-12-16 15:29:35 UTC
Version:           3.5 (using KDE 3.5.0, Kubuntu Package 4:3.5.0-0ubuntu0breezy1 breezy)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.12-8-386

I edited an HTML file. This file have XML comments and when I click "Tools->Format XML Code", it does not format comments correctly.
To be exact, here's an example:

Original:
<!-- hello -->
<p>hello</p>
"Formatted":
<!-- hello <>
<p>hello</p>

As far as I can notice, the ending comment tag ("-->") is always misformatted as "<>". My simple workaround for this is after I format, I'll just replace all "<>" by "-->" since no valid tag such as "<>".
Comment 1 András Manţia 2005-12-21 17:13:51 UTC
SVN commit 490355 by amantia:

Don't loose the comment closing character when formatting the XML code.

BUG: 118453

 M  +1 -0      ChangeLog  
 M  +6 -1      parts/kafka/wkafkapart.cpp  


--- branches/KDE/3.5/kdewebdev/quanta/ChangeLog #490354:490355
@@ -5,6 +5,7 @@
         - better handling of quotation marks when editing tags inside a script area [#118693]
         - don't show the file changed dialog after using save as and save again
         - crash fixes in VPL [#118686]
+        - don't loose the comment closing character when formatting the XML code [#118453]
 
 Version 3.5 (Release date: 29-11-2005; Started 04-03-2004):
  - bugfixes:
--- branches/KDE/3.5/kdewebdev/quanta/parts/kafka/wkafkapart.cpp #490354:490355
@@ -1081,7 +1081,12 @@
                     text = ">";
 		}
 		else
-			text = "<" + QuantaCommon::tagCase(node->tag->name) + ">";
+    {
+      if (node->tag->tagStr() == "-->")
+        text = "-->";
+      else
+			 text = "<" + QuantaCommon::tagCase(node->tag->name) + ">";
+    }
 		bCol += text.length();
 		eCol = bCol - 1;
 		eLine = bLine;