if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
str << wxT("<html><head></head><body>\n");
- str << wxT("<table border=0 cellpadding=0 cellspacing=0><tr><td width=\"100%\">");
-
OutputFont(currentParaStyle, str);
m_font = false;
}
wxRichTextImage* image = wxDynamicCast(obj, wxRichTextImage);
- if( image && !image->IsEmpty())
+ if( image && (!image->IsEmpty() || image->GetImageBlock().GetData()))
WriteImage( image, stream );
node2 = node2->GetNext();
str << wxT("</font>");
- str << wxT("</td></tr></table><p>");
-
if ((GetFlags() & wxRICHTEXT_HANDLER_NO_HEADER_FOOTER) == 0)
str << wxT("</body></html>");
{
if (thisStyle.HasPageBreak())
{
- str << wxT("</tr></td></table>");
str << wxT("<div style=\"page-break-after:always\"></div>\n");
- str << wxT("<table border=0 cellpadding=0 cellspacing=0><tr><td width=\"100%\">");
}
if (thisStyle.HasLeftIndent() && thisStyle.GetLeftIndent() != 0)
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;
}
if (thisStyle.HasFont())
stream << wxT("</font>");
- stream << wxT("</td></tr></table>\n");
+ stream << wxT("</td></tr></table></p>\n");
m_inTable = false;
}
+ else if (!thisStyle.HasBulletStyle())
+ stream << wxT("</p>\n");
}
/// Closes lists to level (-1 means close all)