From cdaa629cee4d0265519952c8e6baa1affdb54e7e Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Thu, 15 Nov 2012 17:12:05 -0800 Subject: [PATCH] Add tests for empty attribute values in tags and table syntax The PHP parser implements this very inconsistently and not in line with the HTML5 spec. We follow the HTML5 spec in Parsoid, so mark these tests as disabled for the PHP parser and add FIXMEs. Change-Id: Iee5d95f3ee5fcb596282097c52f729d33ccb1474 --- tests/parser/parserTests.txt | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index ff0649b711..94cad8411e 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -2824,6 +2824,24 @@ Table with row followed by newlines and table heading !! end +# FIXME: Preserve the attribute properly (with an empty string as value) in +# the PHP parser. Parsoid implements the behavior below. +!! test +Table attributes with empty value +!! options +disabled +!! input +{| +| style=| hello +|} +!! result + + +
hello +
+ +!! end + ### ### Internal links ### @@ -7080,6 +7098,37 @@ div with illegal double attributes !!end +# FIXME: produce empty string instead of "class" in the PHP parser, following +# the HTML5 spec. +!! test +div with empty attribute value, space before equals +!! options +disabled +!! input +
HTML rocks
+!! result +
HTML rocks
+ +!! end + +# This it very inconsistent in the PHP parser: it returns +# class="class" if there is a space between the name and the equal sign (see +# 'div with empty attribute value, space before equals'), but strips the +# attribute completely if the space is missing. We hope that not much content +# depends on this, so are implementing the behavior below in Parsoid for +# consistencies' sake. Disabled for the PHP parser. +# FIXME: fix this behavior in the PHP parser? +!! test +div with empty attribute value, no space before equals +!! options +disabled +!! input +
HTML rocks
+!! result +
HTML rocks
+ +!! end + !! test HTML multiple attributes correction !! input -- 2.20.1