X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7bf6f523e7a41c094765bd5dc42da71342e5e32c..4521f6c88cbefa7f13e3733d344776b795f981e4:/src/html/m_pre.cpp diff --git a/src/html/m_pre.cpp b/src/html/m_pre.cpp index c4a33f8c82..cc0664f86a 100644 --- a/src/html/m_pre.cpp +++ b/src/html/m_pre.cpp @@ -2,7 +2,6 @@ // Name: src/html/m_pre.cpp // Purpose: wxHtml module for
 ... 
tag (code citation) // Author: Vaclav Slavik -// RCS-ID: $Id$ // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -47,9 +46,22 @@ static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str) if ( i == end ) return out; break; + + // We need to translate any line break into exactly one
. + // Quoting HTML spec: "A line break is defined to be a carriage + // return ( ), a line feed ( ), or a carriage + // return/line feed pair." + case '\r': + { + wxString::const_iterator j(i + 1); + if ( j != end && *j == '\n' ) + i = j; + } + // fall through case '\n': out << "
"; break; + default: out << *i; break;