Bug 49630 - HTML Export: final <i> and <b> tags are not closed
Summary: HTML Export: final <i> and <b> tags are not closed
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: 4.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-24 16:16 UTC by bernhardberger
Modified: 2003-01-21 10:36 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 bernhardberger 2002-10-24 16:16:59 UTC
Version:           4.0 (using KDE 3.0.4)
Compiler:          gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-112)
OS:          Linux (i686) release 2.4.18-3

I have found a bug in the export of sourcecode with syntaxhighlighting to HTML (menu File/Export/Html) in KWrite:

When the last word of your sourcecode is defined as bold or italic (f.ex. a keyword etc.), then the export forgets to close the <b> or <i> tag with an </b>, </i>, so the html code is not valid. 

Only the <span>-Tag will be closed, not <b> or <i>.
Comment 1 Hamish Rodda 2003-01-21 10:36:41 UTC
Subject: kdelibs/kate/part

CVS commit by rodda: 

Close final <b> and <i> tags on HTML Export.

Backport.

CCMAIL:49630-done@bugs.kde.org


  M +8 -1      katedocument.cpp   1.419


--- kdelibs/kate/part/katedocument.cpp  #1.418:1.419
@@ -4722,4 +4722,11 @@ bool KateDocument::exportDocumentToHTML(
     (*outputStream) << endl;
   }
+
+  // Be good citizens and close our tags
+  if (previousCharacterWasBold)
+    (*outputStream) << "</b>";
+  if (previousCharacterWasItalic)
+    (*outputStream) << "</i>";
+
   // HTML document end :
   (*outputStream) << "</span>";  // i'm guaranteed a span is started (i started one at the beginning of the output).