Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
52a3178b
Unverified
Commit
52a3178b
authored
Aug 21, 2022
by
Michael Rowley
Committed by
GitHub
Aug 21, 2022
Browse files
Update showdown.js (#518)
parent
a633d9a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
renard-wx/lib/wxParse/showdown.js
View file @
52a3178b
...
...
@@ -1157,29 +1157,7 @@ showdown.subParser('anchors', function (text, options, globals) {
};
// First, handle reference-style links: [link text] [id]
/*
text = text.replace(/
( // wrap whole match in $1
\[
(
(?:
\[[^\]]*\] // allow brackets nested one level
|
[^\[] // or anything else
)*
)
\]
[ ]? // one optional space
(?:\n[ ]*)? // one optional newline followed by spaces
\[
(.*?) // id = $3
\]
)()()()() // pad remaining backreferences
/g,_DoAnchors_callback);
*/
text
=
text
.
replace
(
/
(\[((?:\[[^\]]
*]|
[^\[\]])
*
)
]
[
]?(?:\n[
]
*
)?\[(
.*
?)
]
)()()()()
/g
,
writeAnchorTag
);
text
=
text
.
replace
(
/
(\[[^\]\n]
+
\]\s
*
){2}
/g
,
writeAnchorTag
);
//
// Next, inline-style links: [link text](url "optional title")
...
...
@@ -1241,10 +1219,10 @@ showdown.subParser('autoLinks', function (text, options, globals) {
text
=
globals
.
converter
.
_dispatch
(
'
autoLinks.before
'
,
text
,
options
,
globals
);
var
simpleURLRegex
=
/
\b(((
https
?
|ftp|dict
)
:
\/\/
|www
\.)[^
'">
\s]
+
\.[^
'">
\s]
+
)(?=\
s
|$
)(?![
"
<>
])
/gi
,
var
simpleURLRegex
=
/
\b(((
https
?
|ftp|dict
)
:
\/\/
|www
\.)[^
'">
\s]
+
\.[^
'">
\s]
+
)(?=\
b
)(?![
^
<>
]
*>
)
/gi
,
delimUrlRegex
=
/<
(((
https
?
|ftp|dict
)
:
\/\/
|www
\.)[^
'">
\s]
+
)
>/gi
,
simpleMailRegex
=
/
(?:
^|
[
\n\t])([
A-Za-z0-9!#$%&'*+-
/
=?^_`
\{
|}~
\.]
+@
[
-a-z0-9
]
+
(\.[
-a-z0-9
]
+
)
*
\.[
a-z
]
+
)(?:
$|
[
\n\t]
)
/gi
,
delimMailRegex
=
/<
(?:
mailto:
)?([
-.
\w]
+@
[
-a-z0-9
]
+
(\.[
-a-z0-9
]
+
)
*
\.[
a-z
]
+
)
>/gi
;
simpleMailRegex
=
/
(?:
\b)([\w\d\.\-\+]{1,256}\@[\w\d\.\-\+]{1,256}\.\w{1,24}
+
)(?:\b
)
/gi
,
delimMailRegex
=
/<
(?:
mailto:
)?([
\w\d\.\-\+]{1,256}\@[\w\d\.\-\+]{1,256}\.\w{1,24}
)
>/gi
;
text
=
text
.
replace
(
delimUrlRegex
,
replaceLink
);
text
=
text
.
replace
(
delimMailRegex
,
replaceMail
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment