html-validate 7.7.1 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/browser.d.ts +4 -2
- package/dist/cjs/browser.js +12 -7
- package/dist/cjs/browser.js.map +1 -1
- package/dist/cjs/cli.js +2 -0
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core.d.ts +33 -67
- package/dist/cjs/core.js +410 -2452
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/elements.js +4213 -0
- package/dist/cjs/elements.js.map +1 -0
- package/dist/cjs/html-validate.js +3 -0
- package/dist/cjs/html-validate.js.map +1 -1
- package/dist/cjs/index.d.ts +5 -3
- package/dist/cjs/index.js +12 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/jest-lib.js +1 -0
- package/dist/cjs/jest-lib.js.map +1 -1
- package/dist/cjs/jest.d.ts +1 -1
- package/dist/cjs/jest.js +3 -0
- package/dist/cjs/jest.js.map +1 -1
- package/dist/cjs/meta-helper.d.ts +27 -0
- package/dist/cjs/meta-helper.js +64 -0
- package/dist/cjs/meta-helper.js.map +1 -0
- package/dist/cjs/rules-helper.d.ts +45 -0
- package/dist/cjs/rules-helper.js +408 -0
- package/dist/cjs/rules-helper.js.map +1 -0
- package/dist/cjs/test-utils.d.ts +1 -1
- package/dist/es/browser.d.ts +4 -2
- package/dist/es/browser.js +4 -2
- package/dist/es/browser.js.map +1 -1
- package/dist/es/cli.js +3 -1
- package/dist/es/cli.js.map +1 -1
- package/dist/es/core.d.ts +33 -67
- package/dist/es/core.js +377 -2422
- package/dist/es/core.js.map +1 -1
- package/dist/es/elements.js +4210 -0
- package/dist/es/elements.js.map +1 -0
- package/dist/es/html-validate.js +4 -2
- package/dist/es/html-validate.js.map +1 -1
- package/dist/es/index.d.ts +5 -3
- package/dist/es/index.js +4 -2
- package/dist/es/index.js.map +1 -1
- package/dist/es/jest-lib.js +2 -1
- package/dist/es/jest-lib.js.map +1 -1
- package/dist/es/jest.d.ts +1 -1
- package/dist/es/jest.js +3 -1
- package/dist/es/jest.js.map +1 -1
- package/dist/es/meta-helper.d.ts +27 -0
- package/dist/es/meta-helper.js +61 -0
- package/dist/es/meta-helper.js.map +1 -0
- package/dist/es/rules-helper.d.ts +45 -0
- package/dist/es/rules-helper.js +398 -0
- package/dist/es/rules-helper.js.map +1 -0
- package/dist/es/test-utils.d.ts +1 -1
- package/elements/html5.js +1 -2119
- package/package.json +14 -13
- package/elements/README.md +0 -49
- package/elements/entities.json +0 -1724
package/dist/es/core.d.ts
CHANGED
|
@@ -944,6 +944,23 @@ interface Location {
|
|
|
944
944
|
*/
|
|
945
945
|
readonly size: number;
|
|
946
946
|
}
|
|
947
|
+
/**
|
|
948
|
+
* Calculate a new location by offsetting this location.
|
|
949
|
+
*
|
|
950
|
+
* If the references text with newlines the wrap parameter must be set to
|
|
951
|
+
* properly calculate line and column information. If not given the text is
|
|
952
|
+
* assumed to contain no newlines.
|
|
953
|
+
*
|
|
954
|
+
* @public
|
|
955
|
+
* @param location - Source location
|
|
956
|
+
* @param begin - Start location. Default is 0.
|
|
957
|
+
* @param end - End location. Default is size of location. Negative values are
|
|
958
|
+
* counted from end, e.g. `-2` means `size - 2`.
|
|
959
|
+
* @param wrap - If given, line/column is wrapped for each newline occuring
|
|
960
|
+
* before location end.
|
|
961
|
+
*/
|
|
962
|
+
declare function sliceLocation(location: Location, begin: number, end?: number, wrap?: string): Location;
|
|
963
|
+
declare function sliceLocation(location: Location | null | undefined, begin: number, end?: number, wrap?: string): Location | null;
|
|
947
964
|
|
|
948
965
|
/**
|
|
949
966
|
* @public
|
|
@@ -1171,6 +1188,13 @@ interface Plugin {
|
|
|
1171
1188
|
elementSchema?: SchemaValidationPatch | null;
|
|
1172
1189
|
}
|
|
1173
1190
|
|
|
1191
|
+
/**
|
|
1192
|
+
* Helper function to assist IDE with completion and type-checking.
|
|
1193
|
+
*
|
|
1194
|
+
* @public
|
|
1195
|
+
*/
|
|
1196
|
+
declare function definePlugin(plugin: Plugin): Plugin;
|
|
1197
|
+
|
|
1174
1198
|
/**
|
|
1175
1199
|
* @public
|
|
1176
1200
|
*/
|
|
@@ -1745,30 +1769,6 @@ interface ElementTable {
|
|
|
1745
1769
|
[tagName: string]: MetaElement;
|
|
1746
1770
|
}
|
|
1747
1771
|
|
|
1748
|
-
/**
|
|
1749
|
-
* Helper function to assist IDE with completion and type-checking.
|
|
1750
|
-
*
|
|
1751
|
-
* @public
|
|
1752
|
-
*/
|
|
1753
|
-
declare function defineMetadata(metatable: MetaDataTable): MetaDataTable;
|
|
1754
|
-
|
|
1755
|
-
/**
|
|
1756
|
-
* Helpers when writing element metadata.
|
|
1757
|
-
*
|
|
1758
|
-
* @public
|
|
1759
|
-
*/
|
|
1760
|
-
interface MetadataHelper {
|
|
1761
|
-
/** Returns an error if another attribute is omitted, i.e. it requires another attribute to be present to pass. */
|
|
1762
|
-
allowedIfAttributeIsPresent(...attr: string[]): MetaAttributeAllowedCallback;
|
|
1763
|
-
/** Returns an error if another attribute is present, i.e. it requires another attribute to be omitted to pass. */
|
|
1764
|
-
allowedIfAttributeIsAbsent(...attr: string[]): MetaAttributeAllowedCallback;
|
|
1765
|
-
/** Returns an error if another attribute does not have one of the listed values */
|
|
1766
|
-
allowedIfAttributeHasValue(attr: string, value: string[], options?: {
|
|
1767
|
-
defaultValue?: string | null;
|
|
1768
|
-
}): MetaAttributeAllowedCallback;
|
|
1769
|
-
}
|
|
1770
|
-
declare const metadataHelper: MetadataHelper;
|
|
1771
|
-
|
|
1772
1772
|
/**
|
|
1773
1773
|
* @public
|
|
1774
1774
|
*/
|
|
@@ -2282,48 +2282,6 @@ declare class StaticConfigLoader extends ConfigLoader {
|
|
|
2282
2282
|
/** @public */
|
|
2283
2283
|
declare const version: string;
|
|
2284
2284
|
|
|
2285
|
-
declare const HTML_CACHE_KEY: unique symbol;
|
|
2286
|
-
declare const A11Y_CACHE_KEY: unique symbol;
|
|
2287
|
-
declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
|
|
2288
|
-
declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
|
|
2289
|
-
/**
|
|
2290
|
-
* @public
|
|
2291
|
-
*/
|
|
2292
|
-
declare enum TextClassification {
|
|
2293
|
-
EMPTY_TEXT = 0,
|
|
2294
|
-
DYNAMIC_TEXT = 1,
|
|
2295
|
-
STATIC_TEXT = 2
|
|
2296
|
-
}
|
|
2297
|
-
/**
|
|
2298
|
-
* @public
|
|
2299
|
-
*/
|
|
2300
|
-
interface TextClassificationOptions {
|
|
2301
|
-
/** If `true` only accessible text is considered (default false) */
|
|
2302
|
-
accessible?: boolean;
|
|
2303
|
-
/** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
|
|
2304
|
-
* (and parents) elements (default false) */
|
|
2305
|
-
ignoreHiddenRoot?: boolean;
|
|
2306
|
-
}
|
|
2307
|
-
declare module "../../dom/cache" {
|
|
2308
|
-
interface DOMNodeCache {
|
|
2309
|
-
[HTML_CACHE_KEY]: TextClassification;
|
|
2310
|
-
[A11Y_CACHE_KEY]: TextClassification;
|
|
2311
|
-
[IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
|
|
2312
|
-
[IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
/**
|
|
2316
|
-
* Checks text content of an element.
|
|
2317
|
-
*
|
|
2318
|
-
* Any text is considered including text from descendant elements. Whitespace is
|
|
2319
|
-
* ignored.
|
|
2320
|
-
*
|
|
2321
|
-
* If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
|
|
2322
|
-
*
|
|
2323
|
-
* @public
|
|
2324
|
-
*/
|
|
2325
|
-
declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
|
|
2326
|
-
|
|
2327
2285
|
/**
|
|
2328
2286
|
* @public
|
|
2329
2287
|
*/
|
|
@@ -2421,6 +2379,13 @@ declare class FileSystemConfigLoader extends ConfigLoader {
|
|
|
2421
2379
|
*/
|
|
2422
2380
|
declare type Formatter = (results: Result[]) => string;
|
|
2423
2381
|
|
|
2382
|
+
interface AvailableFormatters {
|
|
2383
|
+
checkstyle: Formatter;
|
|
2384
|
+
codeframe: Formatter;
|
|
2385
|
+
json: Formatter;
|
|
2386
|
+
stylish: Formatter;
|
|
2387
|
+
text: Formatter;
|
|
2388
|
+
}
|
|
2424
2389
|
/**
|
|
2425
2390
|
* Get formatter function by name.
|
|
2426
2391
|
*
|
|
@@ -2428,6 +2393,7 @@ declare type Formatter = (results: Result[]) => string;
|
|
|
2428
2393
|
* @param name - Name of formatter.
|
|
2429
2394
|
* @returns Formatter function or null if it doesn't exist.
|
|
2430
2395
|
*/
|
|
2396
|
+
declare function getFormatter(name: keyof AvailableFormatters): Formatter;
|
|
2431
2397
|
declare function getFormatter(name: string): Formatter | null;
|
|
2432
2398
|
|
|
2433
|
-
export {
|
|
2399
|
+
export { Event as $, AttributeData as A, Message as B, Config as C, DynamicValue as D, EventDump as E, Result as F, DeferredMessage as G, HtmlValidate as H, TransformContext as I, Transformer as J, TemplateExtractor as K, Location as L, MetaData as M, NodeClosed as N, Plugin as O, ProcessAttributeCallback as P, SchemaValidationPatch as Q, Rule as R, Severity as S, TextNode as T, UserError as U, definePlugin as V, WrappedError as W, Parser as X, ruleExists as Y, EventHandler as Z, EventCallback as _, ConfigData as a, ConfigReadyEvent as a0, SourceReadyEvent as a1, TokenEvent as a2, TagStartEvent as a3, TagOpenEvent as a4, TagEndEvent as a5, TagCloseEvent as a6, TagReadyEvent as a7, ElementReadyEvent as a8, AttributeEvent as a9, WhitespaceEvent as aa, ConditionalEvent as ab, DirectiveEvent as ac, DoctypeEvent as ad, DOMLoadEvent as ae, DOMReadyEvent as af, TriggerEventMap as ag, ListenEventMap as ah, FileSystemConfigLoader as ai, Formatter as aj, getFormatter as ak, compatibilityCheck as al, CompatibilityOptions as am, ConfigError as b, ConfigLoader as c, StaticConfigLoader as d, HtmlElement as e, CSSStyleDeclaration as f, TokenDump as g, SchemaValidationError as h, NestedError as i, MetaDataTable as j, MetaElement as k, MetaAttribute as l, MetaAttributeAllowedCallback as m, MetaTable as n, MetaCopyableProperty as o, presets as p, RuleConstructor as q, RuleDocumentation as r, Source as s, SourceHooks as t, ProcessElementCallback as u, version as v, ProcessElementContext as w, sliceLocation as x, Report as y, Reporter as z };
|