Index: branches/visual_diff/phase3/skins/common/diff.css |
— | — | @@ -80,19 +80,16 @@ |
81 | 81 | */ |
82 | 82 | span.diff-html-added { |
83 | 83 | font-size: 100%; |
84 | | - color: black; |
85 | | - background-color: #ccffcc; /* light green */ |
| 84 | + background-color: #20ff20 |
86 | 85 | } |
87 | 86 | |
88 | 87 | span.diff-html-removed { |
89 | 88 | font-size: 100%; |
90 | | - color: black; |
91 | 89 | text-decoration: line-through; |
92 | | - background-color: #fdc6c6; /* light red */ |
| 90 | + background-color: #ff2020 |
93 | 91 | } |
94 | 92 | |
95 | 93 | span.diff-html-changed { |
96 | | - color: black; |
97 | 94 | background: url(images/diffunderline.gif) bottom repeat-x; |
98 | 95 | *background-color: #c6c6fd; /* light blue */ |
99 | 96 | } |
Index: branches/visual_diff/phase3/includes/HTMLDiff.php |
— | — | @@ -760,7 +760,7 @@ |
761 | 761 | |
762 | 762 | public function characters($parser, $data){ |
763 | 763 | //wfDebug('Parsing '. strlen($data).' characters.'); |
764 | | - $array = preg_split('//', $data, -1, PREG_SPLIT_NO_EMPTY); |
| 764 | + $array = str_split($data); |
765 | 765 | foreach($array as $c) { |
766 | 766 | if (self::isDelimiter($c)) { |
767 | 767 | $this->endWord(); |
— | — | @@ -796,9 +796,6 @@ |
797 | 797 | } |
798 | 798 | |
799 | 799 | public static function isDelimiter($c) { |
800 | | - if (WhiteSpaceNode::isWhiteSpace($c)){ |
801 | | - return true; |
802 | | - } |
803 | 800 | switch ($c) { |
804 | 801 | // Basic Delimiters |
805 | 802 | case '/': |
— | — | @@ -827,7 +824,7 @@ |
828 | 825 | case ':': |
829 | 826 | return true; |
830 | 827 | default: |
831 | | - return false; |
| 828 | + return WhiteSpaceNode::isWhiteSpace($c); |
832 | 829 | } |
833 | 830 | } |
834 | 831 | |
— | — | @@ -1245,7 +1242,7 @@ |
1246 | 1243 | $nbOthers = sizeof($other->leafs); |
1247 | 1244 | $nbThis = sizeof($this->leafs); |
1248 | 1245 | if($nbOthers == 0 || $nbThis == 0){ |
1249 | | - return log(0); |
| 1246 | + return -log(0); |
1250 | 1247 | } |
1251 | 1248 | |
1252 | 1249 | $diffengine = new _DiffEngine(); |
— | — | @@ -1537,7 +1534,7 @@ |
1538 | 1535 | $txt->addHtml('<b>'); |
1539 | 1536 | $txt->addText(strtolower($this->getDescription())); |
1540 | 1537 | $txt->addHtml('</b>'); |
1541 | | - } else if (sem == TagToStringFactory::STYLE) { |
| 1538 | + } else if ($this->sem == TagToStringFactory::STYLE) { |
1542 | 1539 | $txt->addHtml('<b>'); |
1543 | 1540 | $txt->addText($this->getDescription()); |
1544 | 1541 | $txt->addHtml('</b>'); |
— | — | @@ -1559,7 +1556,7 @@ |
1560 | 1557 | $txt->addHtml('<b>'); |
1561 | 1558 | $txt->addText(strtolower($this->getDescription())); |
1562 | 1559 | $txt->addHtml('</b>'); |
1563 | | - } else if (sem == TagToStringFactory::STYLE) { |
| 1560 | + } else if ($this->sem == TagToStringFactory::STYLE) { |
1564 | 1561 | $txt->addHtml('<b>'); |
1565 | 1562 | $txt->addText($this->getDescription()); |
1566 | 1563 | $txt->addHtml('</b>'); |
— | — | @@ -1958,7 +1955,7 @@ |
1959 | 1956 | function startElement($qname, /*array*/ $arguments){ |
1960 | 1957 | echo '<'.$qname; |
1961 | 1958 | foreach($arguments as $key => $value){ |
1962 | | - echo ' '.$key.'="'.$value.'"'; |
| 1959 | + echo ' '.$key.'="'.Sanitizer::encodeAttribute($value).'"'; |
1963 | 1960 | } |
1964 | 1961 | echo '>'; |
1965 | 1962 | } |
— | — | @@ -1984,7 +1981,7 @@ |
1985 | 1982 | function startElement($qname, /*array*/ $arguments){ |
1986 | 1983 | $this->delegate->addHtml('<'.$qname) ; |
1987 | 1984 | foreach($arguments as $key => $value){ |
1988 | | - $this->delegate->addHtml(' '.$key.'="'.$value.'"'); |
| 1985 | + $this->delegate->addHtml(' '.$key.'="'. Sanitizer::encodeAttribute($value) .'"'); |
1989 | 1986 | } |
1990 | 1987 | $this->delegate->addHtml('>'); |
1991 | 1988 | } |