| @@ 1137-1176 (lines=40) @@ | ||
| 1134 | return $this->assertEquals( $output, wptexturize( $input ) ); |
|
| 1135 | } |
|
| 1136 | ||
| 1137 | function data_quoted_numbers() { |
|
| 1138 | return array( |
|
| 1139 | array( |
|
| 1140 | 'word "42.00" word', |
|
| 1141 | 'word “42.00” word', |
|
| 1142 | ), |
|
| 1143 | array( |
|
| 1144 | 'word "42.00"word', |
|
| 1145 | 'word “42.00”word', |
|
| 1146 | ), |
|
| 1147 | array( |
|
| 1148 | "word '42.00' word", |
|
| 1149 | "word ‘42.00’ word", |
|
| 1150 | ), |
|
| 1151 | array( |
|
| 1152 | "word '42.00'word", |
|
| 1153 | "word ‘42.00’word", |
|
| 1154 | ), |
|
| 1155 | array( |
|
| 1156 | 'word "42" word', |
|
| 1157 | 'word “42” word', |
|
| 1158 | ), |
|
| 1159 | array( |
|
| 1160 | 'word "42,00" word', |
|
| 1161 | 'word “42,00” word', |
|
| 1162 | ), |
|
| 1163 | array( |
|
| 1164 | 'word "4,242.00" word', |
|
| 1165 | 'word “4,242.00” word', |
|
| 1166 | ), |
|
| 1167 | array( |
|
| 1168 | "word '99's word", |
|
| 1169 | "word ’99’s word", |
|
| 1170 | ), |
|
| 1171 | array( |
|
| 1172 | "word '99'samsonite", |
|
| 1173 | "word ’99’samsonite", |
|
| 1174 | ), |
|
| 1175 | ); |
|
| 1176 | } |
|
| 1177 | ||
| 1178 | /** |
|
| 1179 | * Quotations should be allowed to have dashes around them. |
|
| @@ 1782-1821 (lines=40) @@ | ||
| 1779 | return $this->assertEquals( $output, wptexturize( $input ) ); |
|
| 1780 | } |
|
| 1781 | ||
| 1782 | function data_element_stack() { |
|
| 1783 | return array( |
|
| 1784 | array( |
|
| 1785 | '<span>hello</code>---</span>', |
|
| 1786 | '<span>hello</code>—</span>', |
|
| 1787 | ), |
|
| 1788 | array( |
|
| 1789 | '</code>hello<span>---</span>', |
|
| 1790 | '</code>hello<span>—</span>', |
|
| 1791 | ), |
|
| 1792 | array( |
|
| 1793 | '<code>hello</code>---</span>', |
|
| 1794 | '<code>hello</code>—</span>', |
|
| 1795 | ), |
|
| 1796 | array( |
|
| 1797 | '<span>hello</span>---<code>', |
|
| 1798 | '<span>hello</span>—<code>', |
|
| 1799 | ), |
|
| 1800 | array( |
|
| 1801 | '<span>hello<code>---</span>', |
|
| 1802 | '<span>hello<code>---</span>', |
|
| 1803 | ), |
|
| 1804 | array( |
|
| 1805 | '<code>hello<span>---</span>', |
|
| 1806 | '<code>hello<span>---</span>', |
|
| 1807 | ), |
|
| 1808 | array( |
|
| 1809 | '<code>hello</span>---</span>', |
|
| 1810 | '<code>hello</span>---</span>', |
|
| 1811 | ), |
|
| 1812 | array( |
|
| 1813 | '<span><code>hello</code>---</span>', |
|
| 1814 | '<span><code>hello</code>—</span>', |
|
| 1815 | ), |
|
| 1816 | array( |
|
| 1817 | '<code>hello</code>world<span>---</span>', |
|
| 1818 | '<code>hello</code>world<span>—</span>', |
|
| 1819 | ), |
|
| 1820 | ); |
|
| 1821 | } |
|
| 1822 | ||
| 1823 | /** |
|
| 1824 | * Test disabling shortcode texturization. |
|
| @@ 441-480 (lines=40) @@ | ||
| 438 | return $this->assertEquals( $output, wp_kses( $input, $allowedposttags ) ); |
|
| 439 | } |
|
| 440 | ||
| 441 | function data_slash_zero_removal() { |
|
| 442 | return array( |
|
| 443 | array( |
|
| 444 | 'This \\0 should be no big deal.', |
|
| 445 | 'This \\0 should be no big deal.', |
|
| 446 | ), |
|
| 447 | array( |
|
| 448 | '<div>This \\0 should be no big deal.</div>', |
|
| 449 | '<div>This \\0 should be no big deal.</div>', |
|
| 450 | ), |
|
| 451 | array( |
|
| 452 | '<div align="\\0left">This should be no big deal.</div>', |
|
| 453 | '<div align="\\0left">This should be no big deal.</div>', |
|
| 454 | ), |
|
| 455 | array( |
|
| 456 | 'This <div style="float:\\0left"> is more of a concern.', |
|
| 457 | 'This <div style="float:left"> is more of a concern.', |
|
| 458 | ), |
|
| 459 | array( |
|
| 460 | 'This <div style="float:\\0\\0left"> is more of a concern.', |
|
| 461 | 'This <div style="float:left"> is more of a concern.', |
|
| 462 | ), |
|
| 463 | array( |
|
| 464 | 'This <div style="float:\\\\00left"> is more of a concern.', |
|
| 465 | 'This <div style="float:left"> is more of a concern.', |
|
| 466 | ), |
|
| 467 | array( |
|
| 468 | 'This <div style="float:\\\\\\\\0000left"> is more of a concern.', |
|
| 469 | 'This <div style="float:left"> is more of a concern.', |
|
| 470 | ), |
|
| 471 | array( |
|
| 472 | 'This <div style="float:\\0000left"> is more of a concern.', |
|
| 473 | 'This <div style="float:left"> is more of a concern.', |
|
| 474 | ), |
|
| 475 | array( |
|
| 476 | '<style type="text/css">div {background-image:\\0}</style>', |
|
| 477 | 'div {background-image:\\0}', |
|
| 478 | ), |
|
| 479 | ); |
|
| 480 | } |
|
| 481 | ||
| 482 | /** |
|
| 483 | * Test new function wp_kses_hair_parse(). |
|
| @@ 171-226 (lines=56) @@ | ||
| 168 | $this->assertEquals( $content, $result ); |
|
| 169 | } |
|
| 170 | ||
| 171 | function data_autoembed() { |
|
| 172 | return array( |
|
| 173 | ||
| 174 | // Should embed |
|
| 175 | array( |
|
| 176 | 'https://w.org', |
|
| 177 | '[embed]' |
|
| 178 | ), |
|
| 179 | array( |
|
| 180 | 'test |
|
| 181 | https://w.org |
|
| 182 | test', |
|
| 183 | 'test |
|
| 184 | [embed] |
|
| 185 | test' |
|
| 186 | ), |
|
| 187 | array( |
|
| 188 | '<p class="test">https://w.org</p>', |
|
| 189 | '<p class="test">[embed]</p>' |
|
| 190 | ), |
|
| 191 | array( |
|
| 192 | '<p> https://w.org </p>', |
|
| 193 | '<p> [embed] </p>' |
|
| 194 | ), |
|
| 195 | array( |
|
| 196 | '<p>test |
|
| 197 | https://w.org |
|
| 198 | test</p>', |
|
| 199 | '<p>test |
|
| 200 | [embed] |
|
| 201 | test</p>' |
|
| 202 | ), |
|
| 203 | array( |
|
| 204 | '<p>https://w.org |
|
| 205 | </p>', |
|
| 206 | '<p>[embed] |
|
| 207 | </p>' |
|
| 208 | ), |
|
| 209 | ||
| 210 | // Should NOT embed |
|
| 211 | array( |
|
| 212 | 'test https://w.org</p>' |
|
| 213 | ), |
|
| 214 | array( |
|
| 215 | '<span>https://w.org</a>' |
|
| 216 | ), |
|
| 217 | array( |
|
| 218 | '<pre>https://w.org |
|
| 219 | </p>' |
|
| 220 | ), |
|
| 221 | array( |
|
| 222 | '<a href="https://w.org"> |
|
| 223 | https://w.org</a>' |
|
| 224 | ), |
|
| 225 | ); |
|
| 226 | } |
|
| 227 | ||
| 228 | /** |
|
| 229 | * @dataProvider data_autoembed |
|