From d96a25be1230b91f3431bfc3b85b4e1f55bf62e6 Mon Sep 17 00:00:00 2001 From: X-L0rd Date: Thu, 3 Mar 2016 22:10:36 +0100 Subject: [PATCH] Support backslashes in topics of HTML help files HTML help file is a Microsoft format and it makes sense to support backslashes in the file names used in it. Closes https://github.com/wxWidgets/wxWidgets/pull/244 --- src/html/helpdata.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index ae27baf634..cc3024883e 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -229,7 +229,10 @@ bool HP_TagHandler::HandleTag(const wxHtmlTag& tag) if (m_name.empty() && tag.GetParam(wxT("NAME")) == wxT("Name")) m_name = tag.GetParam(wxT("VALUE")); if (tag.GetParam(wxT("NAME")) == wxT("Local")) - m_page = tag.GetParam(wxT("VALUE")); + { + m_page = tag.GetParam(wxT("VALUE")); + m_page.Replace("\\", "/"); + } if (tag.GetParam(wxT("NAME")) == wxT("ID")) tag.GetParamAsInt(wxT("VALUE"), &m_id); return false; @@ -683,7 +686,10 @@ bool wxHtmlHelpData::AddBook(const wxString& book) if (wxStrstr(linebuf, wxT("title=")) == linebuf) title = linebuf + wxStrlen(wxT("title=")); if (wxStrstr(linebuf, wxT("default topic=")) == linebuf) - start = linebuf + wxStrlen(wxT("default topic=")); + { + start = linebuf + wxStrlen(wxT("default topic=")); + start.Replace("\\", "/"); + } if (wxStrstr(linebuf, wxT("index file=")) == linebuf) index = linebuf + wxStrlen(wxT("index file=")); if (wxStrstr(linebuf, wxT("contents file=")) == linebuf)