]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed HTML list output
authorJulian Smart <julian@anthemion.co.uk>
Fri, 28 Nov 2008 12:18:00 +0000 (12:18 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 28 Nov 2008 12:18:00 +0000 (12:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtexthtml.cpp

index e958d3f2f10447b9f5e8dbd3ed5f7d1bf8ff6144..2c8694d0c73f04c7e9eeabc550fba3c58c58f4e2 100644 (file)
@@ -239,8 +239,9 @@ void wxRichTextHTMLHandler::BeginParagraphFormatting(const wxTextAttr& WXUNUSED(
                 int listType = TypeOfList(thisStyle, tag);
                 m_listTypes.Add(listType);
 
-                wxString align = GetAlignment(thisStyle);
-                str << wxString::Format(wxT("<p align=\"%s\">"), align.c_str());
+                // wxHTML needs an extra <p> before a list when using <p> ... </p> in previous paragraphs.
+                // TODO: pass a flag that indicates we're using wxHTML.
+                str << wxT("<p>\n");
 
                 str << tag;
             }
@@ -290,7 +291,7 @@ void wxRichTextHTMLHandler::EndParagraphFormatting(const wxTextAttr& WXUNUSED(cu
         stream << wxT("</td></tr></table></p>\n");
         m_inTable = false;
     }
-    else
+    else if (!thisStyle.HasBulletStyle())
         stream << wxT("</p>\n");
 }