Skip to content

Commit

Permalink
feat: 支持中文
Browse files Browse the repository at this point in the history
  • Loading branch information
Ir1d committed Nov 21, 2018
1 parent 2828a0b commit 71bcaf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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, ''))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 71bcaf5

Please sign in to comment.