| | 207 | /** |
| | 208 | * @ticket 22625 |
| | 209 | **/ |
| | 210 | |
| | 211 | function test_encodes_lone_anglebracket() { |
| | 212 | $inputs = array( |
| | 213 | 'This is < That. <blockquote>foo</blockquote> Text <a href="#">link</a>. Post-link text.', |
| | 214 | 'This is <blockquote>foo</blockquote> < that.', |
| | 215 | 'This is <blockquote>foo < bar</blockquote> that.', |
| | 216 | '< blockquote > < foo < blockquote >', |
| | 217 | 'This is <blockquote>foo < < < bar</blockquote> that.', |
| | 218 | '<<blockquote>foo<</blockquote><', |
| | 219 | '<p>I <3 WordPress', |
| | 220 | '<3<div>foo', |
| | 221 | ); |
| | 222 | $expected = array( |
| | 223 | 'This is < That. <blockquote>foo</blockquote> Text <a href="#">link</a>. Post-link text.', |
| | 224 | 'This is <blockquote>foo</blockquote> < that.', |
| | 225 | 'This is <blockquote>foo < bar</blockquote> that.', |
| | 226 | '< blockquote > < foo < blockquote >', |
| | 227 | 'This is <blockquote>foo < < < bar</blockquote> that.', |
| | 228 | '<<blockquote>foo<</blockquote><', |
| | 229 | '<p>I <3 WordPress</p>', |
| | 230 | '<3<div>foo</div>', |
| | 231 | ); |
| | 232 | |
| | 233 | foreach ( $inputs as $key => $input ) { |
| | 234 | $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) ); |
| | 235 | } |
| | 236 | } |