-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
830 additions
and
927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
// Regexps to match html elements | ||
|
||
var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; | ||
const attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; | ||
|
||
var unquoted = '[^"\'=<>`\\x00-\\x20]+'; | ||
var single_quoted = "'[^']*'"; | ||
var double_quoted = '"[^"]*"'; | ||
const unquoted = '[^"\'=<>`\\x00-\\x20]+'; | ||
const single_quoted = "'[^']*'"; | ||
const double_quoted = '"[^"]*"'; | ||
|
||
var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; | ||
const attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; | ||
|
||
var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; | ||
const attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; | ||
|
||
var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; | ||
const open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; | ||
|
||
var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; | ||
var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->'; | ||
var processing = '<[?][\\s\\S]*?[?]>'; | ||
var declaration = '<![A-Z]+\\s+[^>]*>'; | ||
var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>'; | ||
const close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; | ||
const comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->'; | ||
const processing = '<[?][\\s\\S]*?[?]>'; | ||
const declaration = '<![A-Z]+\\s+[^>]*>'; | ||
const cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>'; | ||
|
||
var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + | ||
const HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + | ||
'|' + processing + '|' + declaration + '|' + cdata + ')'); | ||
var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); | ||
const HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); | ||
|
||
export { HTML_TAG_RE, HTML_OPEN_CLOSE_TAG_RE }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.