Skip to content

Commit

Permalink
Do note remove dash unless surrounded by white space or line return
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobesson committed Apr 4, 2019
1 parent b68eb34 commit 64a772c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/vue-plugins/strip-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function install(Vue) {
return value
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1') // external links
.replace(/\[\[[^|]+|([^\]]+)\]\]/g, '$1') // internal links
.replace(/[*_\-#~`]/g, ''); // emphasis, lists and other similar stuff
.replace(/([\\s\n])-(\\s\n)/g, '$1$2') // dash, but only when preceded and followed by a space chare or line return
.replace(/[*_\\#~`]/g, ''); // emphasis and other similar stuff
});
}

0 comments on commit 64a772c

Please sign in to comment.