new wxHtmlParser core and changes implied by it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11112 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2001-07-19 22:31:00 +00:00
parent 6c62a62bf7
commit 211dfeddfc
8 changed files with 370 additions and 110 deletions

View File

@@ -60,20 +60,18 @@ TAG_HANDLER_BEGIN(PRE, "PRE")
c = m_WParser->OpenContainer();
c->SetAlignHor(wxHTML_ALIGN_LEFT);
wxString src, srcMid;
src = *m_WParser->GetSource();
srcMid = src.Mid(tag.GetBeginPos(),
tag.GetEndPos1() - tag.GetBeginPos());
wxString srcMid =
m_WParser->GetSource()->Mid(tag.GetBeginPos(),
tag.GetEndPos1() - tag.GetBeginPos());
srcMid.Replace(wxT("\t"), wxT(" "));
srcMid.Replace(wxT(" "), wxT(" "));
srcMid.Replace(wxT("\n"), wxT("<br>"));
// It is safe to temporarily change the source being parsed,
// provided we restore the state back after parsing
m_Parser->SetSource(srcMid);
m_Parser->SetSourceAndSaveState(srcMid);
m_Parser->DoParsing();
m_Parser->SetSource(src);
m_Parser->RestoreState();
m_WParser->CloseContainer();
c = m_WParser->OpenContainer();