HTML operations.
- Copyright:
-
- Crown Copyright 2016
- License:
-
- Apache-2.0
- Source:
Members
-
<static, constant> CONVERT_ALL
-
- Source:
-
<static, constant> CONVERT_OPTIONS
-
- Default Value:
-
- ["Named entities where possible","Numeric entities","Hex entities"]
- Source:
-
<static, constant> REMOVE_INDENTATION
-
- Default Value:
-
- true
- Source:
-
<static, constant> REMOVE_LINE_BREAKS
-
- Default Value:
-
- true
- Source:
-
<private, static, constant> _byte_to_entity
-
Lookup table to translate byte values to their HTML entity codes.
- Source:
-
<private, static, constant> _entity_to_byte
-
Lookup table to translate HTML entity codes to their byte values.
- Source:
Methods
-
<static> run_to_entity(input, args)
-
To HTML Entity operation.
Parameters:
Name Type Description input
string args
Array.<Object> - Source:
Returns:
- Type
- string
-
<static> run_from_entity(input, args)
-
From HTML Entity operation.
Parameters:
Name Type Description input
string args
Array.<Object> - Source:
Returns:
- Type
- string
-
<static> run_strip_tags(input, args)
-
Strip HTML tags operation.
Parameters:
Name Type Description input
string args
Array.<Object> - Source:
Returns:
- Type
- string
-
<static> run_parse_colour_code(input, args)
-
Parse colour code operation.
Parameters:
Name Type Description input
string args
Array.<Object> - Source:
Returns:
- Type
- html
-
<private, static> _hsl_to_rgb(h, s, l)
-
Converts an HSL color value to RGB. Conversion formula
adapted from http://en.wikipedia.org/wiki/HSL_color_space.
Assumes h, s, and l are contained in the set [0, 1] and
returns r, g, and b in the set [0, 255].Parameters:
Name Type Description h
number The hue
s
number The saturation
l
number The lightness
- Source:
Returns:
The RGB representation
- Type
- Array
-
<private, static> _rgb_to_hsl(r, g, b)
-
Converts an RGB color value to HSL. Conversion formula
adapted from http://en.wikipedia.org/wiki/HSL_color_space.
Assumes r, g, and b are contained in the set [0, 255] and
returns h, s, and l in the set [0, 1].Parameters:
Name Type Description r
number The red color value
g
number The green color value
b
number The blue color value
- Source:
Returns:
The HSL representation
- Type
- Array