mirror of
https://github.com/wekan/wekan.git
synced 2025-12-23 19:00:12 +01:00
Update markdown.
This commit is contained in:
parent
06fb201d80
commit
6e0fa78022
3 changed files with 27 additions and 7 deletions
|
|
@ -364,7 +364,7 @@ block.html = edit$1(block.html, 'i')
|
|||
|
||||
block.paragraph = edit$1(block._paragraph)
|
||||
.replace('hr', block.hr)
|
||||
.replace('heading', ' {0,3}#{1,6} +')
|
||||
.replace('heading', ' {0,3}#{1,6} ')
|
||||
.replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
|
||||
.replace('blockquote', ' {0,3}>')
|
||||
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
||||
|
|
@ -389,9 +389,23 @@ block.normal = merge$1({}, block);
|
|||
|
||||
block.gfm = merge$1({}, block.normal, {
|
||||
nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,
|
||||
table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/
|
||||
table: '^ *\\|(.+)\\n' // Header
|
||||
+ ' *\\|?( *[-:]+[-| :]*)' // Align
|
||||
+ '(?:\\n((?:(?!^|>|\\n| |hr|heading|lheading|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
|
||||
});
|
||||
|
||||
block.gfm.table = edit$1(block.gfm.table)
|
||||
.replace('hr', block.hr)
|
||||
.replace('heading', ' {0,3}#{1,6} ')
|
||||
.replace('lheading', '([^\\n]+)\\n {0,3}(=+|-+) *(?:\\n+|$)')
|
||||
.replace('blockquote', ' {0,3}>')
|
||||
.replace('code', ' {4}[^\\n]')
|
||||
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
|
||||
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
|
||||
.replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
|
||||
.replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
|
||||
.getRegex();
|
||||
|
||||
/**
|
||||
* Pedantic grammar (original John Gruber's loose markdown specification)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue