Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
Fix link titles with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
piascikj committed Jan 8, 2021
1 parent 26999a1 commit 7d72078
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/lib/imdone-vue-lib.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/imdone-vue-lib.min.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imdone-vue-lib",
"version": "0.7.5",
"version": "0.7.6",
"description": "imdone vue components",
"author": "Jesse <[email protected]>",
"main": "dist/lib/imdone-vue-lib.min.js",
Expand All @@ -25,7 +25,7 @@
"cheerio": "^1.0.0-rc.3",
"eol": "^0.9.1",
"gravatar": "^1.6.0",
"imdone-core": "1.8.8",
"imdone-core": "1.8.10",
"json-stringify-safe": "^5.0.1",
"just-compare": "^1.3.0",
"lodash.template": "^4.5.0",
Expand Down
5 changes: 3 additions & 2 deletions src/utils/task-text-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ function getEncodedDescription (description) {
const encodedMD = encodeURIComponent(description)
description = description
.replace(CONTENT_TOKEN, encodedText)
.replace(/(?<!!)\[(.*?)\]\((.*?)\)/g, (match, p1, p2) => { // URI encode file links
const link = `[${p1}](${p2.replace(/\s/g, '%20')})`
.replace(/(?<!!)\[(.*?)\]\((.*?)( ".*?")?\)/g, (match, p1, p2, p3) => { // URI encode file links
const title = p3 || ''
const link = `[${p1}](${p2.replace(/\s/g, '%20')}${title})`
return link.replace(/%20(".*?"\))$/, ' $1')
})
return {encodedMD, encodedText, description}
Expand Down

0 comments on commit 7d72078

Please sign in to comment.