markdown-to-jsx
Advanced tools
Comparing version 6.3.0 to 6.3.1
@@ -83,3 +83,27 @@ 'use strict'; | ||
var HEADING_SETEXT_R = /^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/; | ||
var HTML_BLOCK_ELEMENT_R = /^ *<([^ >/]*) ?([^>]*)>((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1>\n*/; | ||
/** | ||
* Explanation: | ||
* | ||
* 1. Look for a starting tag, preceeded by any amount of spaces | ||
* ^ *< | ||
* | ||
* 2. Capture the tag name (capture 1) | ||
* ([^ >/]+) | ||
* | ||
* 3. Ignore a space after the starting tag and capture the attribute portion of the tag (capture 2) | ||
* ?([^>]*)\/{0}> | ||
* | ||
* 4. Ensure a matching closing tag is present in the rest of the input string | ||
* (?=[\s\S]*<\/\1>) | ||
* | ||
* 5. Capture everything until the matching closing tag -- this might include additional pairs | ||
* of the same tag type found in step 2 (capture 3) | ||
* ((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1> | ||
* | ||
* 6. Capture excess newlines afterward | ||
* \n* | ||
*/ | ||
var HTML_BLOCK_ELEMENT_R = /^ *<([^ >/]+) ?([^>]*)\/{0}>(?=[\s\S]*<\/\1>)((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1>\n*/; | ||
var HTML_COMMENT_R = /^<!--.*?-->/; | ||
@@ -92,3 +116,3 @@ | ||
var HTML_SELF_CLOSING_ELEMENT_R = /^<([^\s]*)\s?(.*?)>(.*?)/; | ||
var HTML_SELF_CLOSING_ELEMENT_R = /^ *<([^/\s]+) ?(.*?)>(?!<\/\1>)\s*/; | ||
var LINK_AUTOLINK_BARE_URL_R = /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/; | ||
@@ -780,3 +804,3 @@ var LINK_AUTOLINK_MAILTO_R = /^<([^ >]+@[^ >]+)>/; | ||
*/ | ||
match: inlineRegex(HTML_SELF_CLOSING_ELEMENT_R), | ||
match: anyScopeRegex(HTML_SELF_CLOSING_ELEMENT_R), | ||
order: PARSE_PRIORITY_HIGH, | ||
@@ -1211,2 +1235,11 @@ parse: function parse(capture /*, parse, state*/) { | ||
// Object.keys(rules).forEach(key => { | ||
// let parse = rules[key].parse; | ||
// rules[key].parse = (...args) => { | ||
// console.log(key, args[0]); | ||
// return parse(...args); | ||
// }; | ||
// }); | ||
var parser = parserFor(rules); | ||
@@ -1213,0 +1246,0 @@ var emitter = reactFor(ruleOutput(rules)); |
@@ -77,3 +77,27 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var HEADING_SETEXT_R = /^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/; | ||
var HTML_BLOCK_ELEMENT_R = /^ *<([^ >/]*) ?([^>]*)>((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1>\n*/; | ||
/** | ||
* Explanation: | ||
* | ||
* 1. Look for a starting tag, preceeded by any amount of spaces | ||
* ^ *< | ||
* | ||
* 2. Capture the tag name (capture 1) | ||
* ([^ >/]+) | ||
* | ||
* 3. Ignore a space after the starting tag and capture the attribute portion of the tag (capture 2) | ||
* ?([^>]*)\/{0}> | ||
* | ||
* 4. Ensure a matching closing tag is present in the rest of the input string | ||
* (?=[\s\S]*<\/\1>) | ||
* | ||
* 5. Capture everything until the matching closing tag -- this might include additional pairs | ||
* of the same tag type found in step 2 (capture 3) | ||
* ((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1> | ||
* | ||
* 6. Capture excess newlines afterward | ||
* \n* | ||
*/ | ||
var HTML_BLOCK_ELEMENT_R = /^ *<([^ >/]+) ?([^>]*)\/{0}>(?=[\s\S]*<\/\1>)((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1>\n*/; | ||
var HTML_COMMENT_R = /^<!--.*?-->/; | ||
@@ -86,3 +110,3 @@ | ||
var HTML_SELF_CLOSING_ELEMENT_R = /^<([^\s]*)\s?(.*?)>(.*?)/; | ||
var HTML_SELF_CLOSING_ELEMENT_R = /^ *<([^/\s]+) ?(.*?)>(?!<\/\1>)\s*/; | ||
var LINK_AUTOLINK_BARE_URL_R = /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/; | ||
@@ -774,3 +798,3 @@ var LINK_AUTOLINK_MAILTO_R = /^<([^ >]+@[^ >]+)>/; | ||
*/ | ||
match: inlineRegex(HTML_SELF_CLOSING_ELEMENT_R), | ||
match: anyScopeRegex(HTML_SELF_CLOSING_ELEMENT_R), | ||
order: PARSE_PRIORITY_HIGH, | ||
@@ -1205,2 +1229,11 @@ parse: function parse(capture /*, parse, state*/) { | ||
// Object.keys(rules).forEach(key => { | ||
// let parse = rules[key].parse; | ||
// rules[key].parse = (...args) => { | ||
// console.log(key, args[0]); | ||
// return parse(...args); | ||
// }; | ||
// }); | ||
var parser = parserFor(rules); | ||
@@ -1207,0 +1240,0 @@ var emitter = reactFor(ruleOutput(rules)); |
39
index.js
@@ -75,3 +75,27 @@ /* @jsx h */ | ||
const HEADING_SETEXT_R = /^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/; | ||
const HTML_BLOCK_ELEMENT_R = /^ *<([^ >/]*) ?([^>]*)>((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1>\n*/; | ||
/** | ||
* Explanation: | ||
* | ||
* 1. Look for a starting tag, preceeded by any amount of spaces | ||
* ^ *< | ||
* | ||
* 2. Capture the tag name (capture 1) | ||
* ([^ >/]+) | ||
* | ||
* 3. Ignore a space after the starting tag and capture the attribute portion of the tag (capture 2) | ||
* ?([^>]*)\/{0}> | ||
* | ||
* 4. Ensure a matching closing tag is present in the rest of the input string | ||
* (?=[\s\S]*<\/\1>) | ||
* | ||
* 5. Capture everything until the matching closing tag -- this might include additional pairs | ||
* of the same tag type found in step 2 (capture 3) | ||
* ((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1> | ||
* | ||
* 6. Capture excess newlines afterward | ||
* \n* | ||
*/ | ||
const HTML_BLOCK_ELEMENT_R = /^ *<([^ >/]+) ?([^>]*)\/{0}>(?=[\s\S]*<\/\1>)((?:[\s\S]*?(?:<\1[^>]*>[\s\S]*?<\/\1>)*[\s\S]*?)*?)<\/\1>\n*/; | ||
const HTML_COMMENT_R = /^<!--.*?-->/; | ||
@@ -84,3 +108,3 @@ | ||
const HTML_SELF_CLOSING_ELEMENT_R = /^<([^\s]*)\s?(.*?)>(.*?)/; | ||
const HTML_SELF_CLOSING_ELEMENT_R = /^ *<([^/\s]+) ?(.*?)>(?!<\/\1>)\s*/; | ||
const LINK_AUTOLINK_BARE_URL_R = /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/; | ||
@@ -808,3 +832,3 @@ const LINK_AUTOLINK_MAILTO_R = /^<([^ >]+@[^ >]+)>/; | ||
*/ | ||
match: inlineRegex(HTML_SELF_CLOSING_ELEMENT_R), | ||
match: anyScopeRegex(HTML_SELF_CLOSING_ELEMENT_R), | ||
order: PARSE_PRIORITY_HIGH, | ||
@@ -1239,2 +1263,11 @@ parse (capture/*, parse, state*/) { | ||
// Object.keys(rules).forEach(key => { | ||
// let parse = rules[key].parse; | ||
// rules[key].parse = (...args) => { | ||
// console.log(key, args[0]); | ||
// return parse(...args); | ||
// }; | ||
// }); | ||
const parser = parserFor(rules); | ||
@@ -1241,0 +1274,0 @@ const emitter = reactFor(ruleOutput(rules)); |
@@ -6,3 +6,3 @@ { | ||
"license": "MIT", | ||
"version": "6.3.0", | ||
"version": "6.3.1", | ||
"engines": { | ||
@@ -9,0 +9,0 @@ "node": ">= 4" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
214269
3507