1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

First pass at linting lib dir

This commit is contained in:
Laurent Cozic
2019-07-29 15:43:53 +02:00
parent 64b7bc3d62
commit 86dc72b204
170 changed files with 4140 additions and 3119 deletions

View File

@ -4,7 +4,6 @@ const MarkdownIt = require('markdown-it');
const setupLinkify = require('lib/renderers/MdToHtml/setupLinkify');
const markdownUtils = {
// Not really escaping because that's not supported by marked.js
escapeLinkText(text) {
return text.replace(/(\[|\]|\(|\))/g, '_');
@ -30,7 +29,7 @@ const markdownUtils = {
const tokens = markdownIt.parse(md, env);
const output = [];
const searchUrls = (tokens) => {
const searchUrls = tokens => {
for (let i = 0; i < tokens.length; i++) {
const token = tokens[i];
@ -42,12 +41,12 @@ const markdownUtils = {
}
}
}
if (token.children && token.children.length) {
searchUrls(token.children);
}
}
}
};
searchUrls(tokens);
@ -87,8 +86,6 @@ const markdownUtils = {
return output.join('\n');
},
};
module.exports = markdownUtils;
module.exports = markdownUtils;