File: text-unclosed-entity.t

package info (click to toggle)
libhtml-lint-perl 2.32%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 356 kB
  • sloc: perl: 1,739; makefile: 6
file content (38 lines) | stat: -rw-r--r-- 1,187 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!perl

use warnings;
use strict;

use lib 't/';
use Util;

checkit( [
    [ 'text-unclosed-entity' => qr/Entity ö is missing its closing semicolon/ ],
    [ 'text-unclosed-entity' => qr/Entity ? is missing its closing semicolon/ ],
    [ 'text-unknown-entity'  => qr/Entity &middle is unknown/ ],
], [<DATA>] );

__DATA__
<html>
    <head>
        <title>Ace of &spades;: A tribute to Mot&ouml;rhead.</title>
        <script>
            function foo() {
                if ( 6 == 9 && 25 == 6 ) {
                    x = 14;
                }
            }
        </script>
    </head>
    <body bgcolor="white">
        Mot&ouml rhead rulez!
        &sup; &sup2; But can we find an unclosed entity at the end of the line &#63
        <p>
        What about unclosed unknown entities in the &middle of the line?
        Here's an awesome link to <a href="http://www.youtube.com/watch?v=8yLhA0ROGi4&amp;feature=related">"You Better Swim"</a> from the SpongeBob movie.
        <!--
        Here in the safety of comments, we can put whatever &invalid; and &malformed entities we want, &
        nobody can stop us.  Except maybe Cheech & Chong.
        -->
    </body>
</html>