summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-02-17 11:40:34 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-02-18 12:58:48 +0000
commit7a044d08572244931b16f24f3f8cc83111b039f9 (patch)
tree49fdd51ad20dc94b0eca68a0f5aba3b62a2a0b33
parentcd361611ed43b24c2d85dc227ece4f6a5d551104 (diff)
fdo#74595 Make HTML detection to follow specs
See http://www.w3.org/TR/html-markup/documents.html#conformant-html Change-Id: Id2835f20baad20bcb874df5e6f35a189c320367b Reviewed-on: https://gerrit.libreoffice.org/8079 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--filter/source/htmlfilterdetect/filterdetect.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/filter/source/htmlfilterdetect/filterdetect.cxx b/filter/source/htmlfilterdetect/filterdetect.cxx
index 140912d37379..9e5350d26fff 100644
--- a/filter/source/htmlfilterdetect/filterdetect.cxx
+++ b/filter/source/htmlfilterdetect/filterdetect.cxx
@@ -53,7 +53,7 @@ bool isHTMLStream(const OString& aStreamHeader)
for ( i = 0; i < nLength; ++i, ++pHeader )
{
char c = *pHeader;
- if ( c == ' ' || c == '\n' || c == '\t' )
+ if ( c == ' ' || c == '\n' || c == '\t' || c == '\r' || c == '\f' )
{
if ( dp == TagOpened )
return false; // Invalid: Should start with a tag name
@@ -76,8 +76,8 @@ bool isHTMLStream(const OString& aStreamHeader)
}
else if ( c == '!' )
{
- if ( i == 1 && dp == TagOpened )
- return true; // "<!" at the very beginning of the file
+ if ( dp == TagOpened )
+ return true; // "<!" - DOCTYPE or comments block
else
return false; // Invalid: '!' before '<' or inside tag name
}