浏览代码

Merge branch 'master' of https://github.com/linlinjava/litemall

linlinjava 3 年之前
父节点
当前提交
fe57793b6c
共有 3 个文件被更改,包括 6 次插入28 次删除
  1. 1 1
      litemall-db/pom.xml
  2. 1 1
      pom.xml
  3. 4 26
      renard-wx/lib/wxParse/showdown.js

+ 1 - 1
litemall-db/pom.xml

@@ -57,7 +57,7 @@
                     <dependency>
                         <groupId>mysql</groupId>
                         <artifactId>mysql-connector-java</artifactId>
-                        <version>8.0.16</version>
+                        <version>8.0.28</version>
                     </dependency>
                     <dependency>
                         <groupId>com.itfsw</groupId>

+ 1 - 1
pom.xml

@@ -86,7 +86,7 @@
             <dependency>
                 <groupId>mysql</groupId>
                 <artifactId>mysql-connector-java</artifactId>
-                <version>8.0.16</version>
+                <version>8.0.28</version>
             </dependency>
 
             <dependency>

+ 4 - 26
renard-wx/lib/wxParse/showdown.js

@@ -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);