diff --git a/index.js b/index.js index 9a17085..c1c9c8a 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ 'use strict' -const regex = /(?:^|\n)[\?\!]{3}(\+)? ?(?:([\w\-]+(?: +[\w\-]+)*?)?(?: +"(.*?)")|([\w\-]+(?: +[\w\-]+)*?)) *(?:\n|$)/gm; +const regex = /(?:^|\n)[\?\!]{3}(\+)? ?(?:([\u4e00-\u9fa5_a-zA-Z0-9\-]+(?: +[\u4e00-\u9fa5_a-zA-Z0-9\-]+)*?)?(?: +"(.*?)")|([\u4e00-\u9fa5_a-zA-Z0-9\-]+(?: +[\u4e00-\u9fa5_a-zA-Z0-9\-]+)*?)) *(?:\n|$)/gm; +// const regex = /(?:^|\n)[\?\!]{3}(\+)? ?(?:([\w\-]+(?: +[\w\-]+)*?)?(?: +"(.*?)")|([\w\-]+(?: +[\w\-]+)*?)) *(?:\n|$)/gm; var tab = '\t' var tabSize = 4 @@ -99,6 +100,10 @@ module.exports = function blockPlugin (opts) { let val = res[2] || res[4] // console.log(val) let title = res[3] || '' + if (res[0][0] == '!') { + title = res[4] + val = '' + } // console.log(subvalue) // console.log(subvalue.replace(regexonce, '')) // console.log(subvalue.replace(regexonce, '')) diff --git a/package.json b/package.json index c223bf0..99baa67 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "remark-details", - "version": "1.0.0", + "version": "1.1.0", "description": "a tokenizer for remark to support details plugin in pymdown", "main": "index.js", "scripts": {