1
0
Fork 0

Fix multi line quote

This commit is contained in:
adrien 2018-09-01 20:23:21 +02:00
parent 90bf0da98e
commit 5e9597e0ee

View File

@ -23,7 +23,7 @@ function encodeAttr(str) {
/** Parse Markdown into an HTML String. */
export default function parse(md, prevLinks) {
let tokenizer = /((?:^|\n+)(?:- ?|_|(?:\* ?)){3,}(?:$|\n+))|(?:^((?:```|:::) *\w*)\n([\s\S]*?)\n(?:```|:::)$)|((?:(?:^|\n+)(?:\t| {2,})[^<\-+* ].+)+\n*)|((?:(?:^|\n)( *[>*+-]+(?! ?[*-])|\d+\.)\s+.*)+)|(?:\!\[([^\]]*?)\]\(([^\)]+?)\))|(\[)|(\](?:\(([^\)]+?)\))?)|(?:(?:^|\n+)([^\s<].*)\n(\-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`(.*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)|(^\d+\\..*)|((?:(?:^|\n+)(?:\|.*))+)|(<?((?:https?:\/\/.+|\S+@\S+)\.\w+.*)>?)|(\\[\\`*_{}[\]()#+-.!])|(\((?:[cC]|[rR]|[pP]|tm|TM)\)|\+-)|[^=:]("([^"\n]*)"|'([^'\n]*)')|(:([^\s:]+?):)/gm,
let tokenizer = /((?:^|\n+)(?:- ?|_|(?:\* ?)){3,}(?:$|\n+))|(?:^((?:```|:::) *\w*)\n([\s\S]*?)\n(?:```|:::)$)|((?:(?:^|\n+)(?:\t| {2,})[^<\-+* ].+)+\n*)|((?:(?:^|\n)( *[>*+-]+(?! ?[*-])|\d+\.) +.+)(?:\n.+)*)|(?:\!\[([^\]]*?)\]\(([^\)]+?)\))|(\[)|(\](?:\(([^\)]+?)\))?)|(?:(?:^|\n+)([^\s<].*)\n(\-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`(.*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)|(^\d+\\..*)|((?:(?:^|\n+)(?:\|.*))+)|(<?((?:https?:\/\/.+|\S+@\S+)\.\w+.*)>?)|(\\[\\`*_{}[\]()#+-.!])|(\((?:[cC]|[rR]|[pP]|tm|TM)\)|\+-)|[^=:]("([^"\n]*)"|'([^'\n]*)')|(:([^\s:]+?):)/gm,
context = [],
out = '',
links = prevLinks || {},