From 71bcaf5ab6822cb501259c6e84fd2a9289b1f239 Mon Sep 17 00:00:00 2001 From: Ir1d Date: Wed, 21 Nov 2018 14:31:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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": {