- Commit
- 9dde9c96a7b7fb9810a60ae65dd2623b03b83da8
- Parent
- a407869dfc062d6ec24f00482aae6019e083d8c7
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
Fixed reMain regex for better performance.
My personal build of CMark ✏️
Fixed reMain regex for better performance.
1 file changed, 1 insertion, 1 deletion
Status | File Name | N° Changes | Insertions | Deletions |
Modified | js/stmd.js | 2 | 1 | 1 |
diff --git a/js/stmd.js b/js/stmd.js @@ -71,7 +71,7 @@ var reHrule = /^(?:(?:\* *){3,}|(?:_ *){3,}|(?:- *){3,}) *$/; // Matches a character with a special meaning in markdown, // or a string of non-special characters. -var reMain = /^(?: +|[\n`\[\]\\!<&*_]|[^\n `\[\]\\!<&*_]+)/m; +var reMain = /^(?:[\n`\[\]\\!<&*_]|(?: *[^\n `\[\]\\!<&*_]+)+|[ \n]+)/m; // UTILITY FUNCTIONS