1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-06 22:46:29 +02:00
joplin/ReactNativeClient/lib/markdown-utils.js

15 lines
315 B
JavaScript
Raw Normal View History

2017-08-02 17:47:25 +00:00
const markdownUtils = {
// Not really escaping because that's not supported by marked.js
escapeLinkText(text) {
2018-03-09 17:49:35 +00:00
return text.replace(/(\[|\]|\(|\))/g, "_");
2017-08-02 17:47:25 +00:00
},
escapeLinkUrl(url) {
2018-03-09 17:49:35 +00:00
url = url.replace(/\(/g, "%28");
url = url.replace(/\)/g, "%29");
2017-08-02 17:47:25 +00:00
return url;
},
};
2018-03-09 17:49:35 +00:00
module.exports = { markdownUtils };