Skip to content

Commit

Permalink
Merge pull request #10 from tolking/dev
Browse files Browse the repository at this point in the history
fix: split `\|`
  • Loading branch information
tolking authored Apr 3, 2021
2 parents 0c1ac73 + 7f24f68 commit df474c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "components-helper",
"version": "1.0.1",
"version": "1.0.2",
"description": "Based on the docs to provide code prompt files for vue component library",
"main": "lib/index.js",
"module": "lib/index.es.js",
Expand Down
5 changes: 3 additions & 2 deletions src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ function parseColumn(str: string): string[] {
return str
.replace(/^\|/, '')
.replace(/\|$/, '')
.replace(/\|/g, ' |')
.replace(/([^\\])\|/g, '$1 |')
.replace(/\|\|/g, '| |')
.split(/[^\\]\|/)
.map((item) => item.trim())
.map((item) => item.replace(/\\\|/g, '|').trim())
}

function parseColumns(
Expand Down

0 comments on commit df474c1

Please sign in to comment.