http://www.mediawiki.org/wiki/Special:Code/MediaWiki/98053

Revision: 98053
Author:   dantman
Date:     2011-09-25 02:58:03 +0000 (Sun, 25 Sep 2011)
Log Message:
-----------
Followup r94465; Add parser tests and turn the feature on-by-default like I 
intended for it (I guess I forgot to return it to true when I was testing it as 
off)

Modified Paths:
--------------
    trunk/phase3/includes/DefaultSettings.php
    trunk/phase3/tests/parser/parserTests.txt

Modified: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php   2011-09-25 02:27:10 UTC (rev 
98052)
+++ trunk/phase3/includes/DefaultSettings.php   2011-09-25 02:58:03 UTC (rev 
98053)
@@ -2186,7 +2186,7 @@
 /**
  * Cleanup as much presentational html like valign -> css vertical-align as we 
can
  */
-$wgCleanupPresentationalAttributes = false;
+$wgCleanupPresentationalAttributes = true;
 
 /**
  * Should we try to make our HTML output well-formed XML?  If set to false,

Modified: trunk/phase3/tests/parser/parserTests.txt
===================================================================
--- trunk/phase3/tests/parser/parserTests.txt   2011-09-25 02:27:10 UTC (rev 
98052)
+++ trunk/phase3/tests/parser/parserTests.txt   2011-09-25 02:58:03 UTC (rev 
98053)
@@ -1346,7 +1346,7 @@
 !! test
 Table rowspan
 !! input
-{| align=right border=1
+{| border=1
 | Cell 1, row 1 
 |rowspan=2| Cell 2, row 1 (and 2) 
 | Cell 3, row 1 
@@ -1355,7 +1355,7 @@
 | Cell 3, row 2 
 |}
 !! result
-<table align="right" border="1">
+<table border="1">
 <tr>
 <td> Cell 1, row 1
 </td>
@@ -1968,13 +1968,13 @@
 !! test 
 Failing to transform badly formed HTML into correct XHTML
 !! input
-<br clear=left>
-<br clear=right>
-<br clear=all>
+<br style="clear: left;">
+<br style="clear: right;">
+<br style="clear: both;">
 !! result
-<p><br clear="left" />
-<br clear="right" />
-<br clear="all" />
+<p><br style="clear: left;" />
+<br style="clear: right;" />
+<br style="clear: both;" />
 </p>
 !!end
 
@@ -4517,9 +4517,9 @@
 !! test
 div with illegal double attributes
 !! input
-<div align="center" align="right">HTML rocks</div>
+<div id="a" id="b">HTML rocks</div>
 !! result
-<div align="right">HTML rocks</div>
+<div id="b">HTML rocks</div>
 
 !!end
 
@@ -4549,9 +4549,9 @@
 !! test
 DIV IN UPPERCASE
 !! input
-<DIV ALIGN="center">HTML ROCKS</DIV>
+<DIV ID="x">HTML ROCKS</DIV>
 !! result
-<div align="center">HTML ROCKS</div>
+<div id="x">HTML ROCKS</div>
 
 !!end
 
@@ -8799,6 +8799,22 @@
 ...
 !! end
 
+!! test
+Deprecated presentational attributes are converted to css
+!! input
+{|
+| valign=top align=left width=100 height=25% | Asdf
+|}
+<ul type="disc"></ul>
+!! result
+<table>
+<tr>
+<td style="text-align: left; height: 25%; vertical-align: top; width: 100px;"> 
Asdf
+</td></tr></table>
+<ul style="list-style-type: disc;"></ul>
+
+!! end
+
 TODO:
 more images
 more tables


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to