mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
md-editor autoindent was duplicating hr markers
only keep characters `>+-*` if there's less than three of them, and discard entire prefix if there's more markdown spec only cares about exactly-one or three-or-more, but let's keep pairs in case anyone use that as unconventional markup
This commit is contained in:
parent
5ad65450c4
commit
692175f5b0
|
@ -607,10 +607,10 @@ function md_newline() {
|
||||||
var s = linebounds(true),
|
var s = linebounds(true),
|
||||||
ln = s.md.substring(s.n1, s.n2),
|
ln = s.md.substring(s.n1, s.n2),
|
||||||
m1 = /^( *)([0-9]+)(\. +)/.exec(ln),
|
m1 = /^( *)([0-9]+)(\. +)/.exec(ln),
|
||||||
m2 = /^[ \t>+-]*(\* )?/.exec(ln),
|
m2 = /^[ \t]*[>+*-]{0,2}[ \t]/.exec(ln),
|
||||||
drop = dom_src.selectionEnd - dom_src.selectionStart;
|
drop = dom_src.selectionEnd - dom_src.selectionStart;
|
||||||
|
|
||||||
var pre = m2[0];
|
var pre = m2 ? m2[0] : '';
|
||||||
if (m1 !== null)
|
if (m1 !== null)
|
||||||
pre = m1[1] + (parseInt(m1[2]) + 1) + m1[3];
|
pre = m1[1] + (parseInt(m1[2]) + 1) + m1[3];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue