Bug 81162 - Quanta Deletes #include comments automatically without asking
Summary: Quanta Deletes #include comments automatically without asking
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: 3.2.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-08 21:28 UTC by Steve Clarke
Modified: 2004-05-20 17:57 UTC (History)
0 users

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 Steve Clarke 2004-05-08 21:28:40 UTC
Version:           3.2.2 (using KDE 3.2.1, Mandrake Linux Cooker i586 - Cooker)
Compiler:          gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)
OS:          Linux (i686) release 2.6.3-4mdk

Manually adding <!--#include virtual="./site/menu.html"--> in the <body> of the HTML where I want my Server Side Include Menu to end up.

When I flip to the WYSIWYG window, and change any of the text that is in the <body> of the document, the comment added above is cleared out to become <---->, which isn't too handy.

Attached below is the offending web page source, and please note that the two files called up, one in the CSS, and one in the #include do not yet exist (the site directory exists and is empty).

Steve Clarke

-- WEB SOURCE BELOW ---------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd">
<html>
<head>
  <title>Header - Page Title</title>
  <meta name="GENERATOR" content="Quanta Plus">
  <link rel="stylesheet" type="text/css" href="./site/site.css">
</head>
<body>

<table width="800" cellspacing="0" border="0" cellpadding="0">
  <tbody>
    <tr>
      <td width="100"><!--#include virtual="./site/menu.html"--></td>
     <td width="700">
        <h1>
              Page Heading
            </h1>
             Type Text in Here
            <br>
            <br>
      </td>
   </tr>
  </tbody>
</table>
</body>
</html>
Comment 1 András Manţia 2004-05-09 09:57:07 UTC
I thought that this is fixed in 3.2.2. But no, I can also reproduce. :-(

Comment 2 András Manţia 2004-05-20 17:57:40 UTC
CVS commit by amantia: 

(Once again) don't lose the comment text from inside a comment.
Backport will follow.

CCMAIL: 81162-done@bugs.kde.org


  M +2 -0      ChangeLog   1.279
  M +27 -0     parsers/saparser.cpp   1.43


--- kdewebdev/quanta/ChangeLog  #1.278:1.279
@@ -4,4 +4,6 @@
 Version 3.3 BE 3 (Release date: xx-xx-2004; Started 07-05-2004):
   - bugfixes:
+        - VPL:
+            - (once again) don't lose the comment text from inside a comment [#81162]
         - correctly load the plugins toolbar [#81031]
         - correctly size the DTD toolbar even when just one toolbar is loaded [#81063]

--- kdewebdev/quanta/parsers/saparser.cpp  #1.42:1.43
@@ -882,5 +882,32 @@ void SAParser::slotParseNodeInDetail()
     } else
     {
+      Node *node = m_currentNode;
       m_currentNode = m_currentNode->nextSibling();
+      if (node->tag->type == Tag::Comment)
+      {
+         Node *commentNode = new Node(node);
+         int line, col;
+         AreaStruct area;
+         node->tag->endPos(line, col);
+         area.bLine = line;
+         area.bCol = col + 1;
+         if (m_currentNode)
+           m_currentNode->tag->beginPos(line, col);
+        else
+         {
+            line = m_write->editIf->numLines() - 1;
+            col = m_write->editIf->lineLength(area.eLine);
+         }
+         area.eLine = line;
+         area.eCol = col - 1;
+         if (area.eCol < 0)
+         {
+             area.eLine--;
+             area.eCol = m_write->editIf->lineLength(area.eLine);
+         }
+         Tag *tag = new Tag(area, m_write, node->tag->dtd(), false);
+         commentNode->tag = tag;
+         node->child = commentNode;
+      }
       if (m_currentNode)
       {