1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-12 08:54:00 +02:00
joplin/ReactNativeClient/lib/markupLanguageUtils.js

20 lines
576 B
JavaScript
Raw Normal View History

const markdownUtils = require('lib/markdownUtils');
const htmlUtils = require('lib/htmlUtils');
const Note = require('lib/models/Note');
class MarkupLanguageUtils {
lib_(language) {
if (language === Note.MARKUP_LANGUAGE_HTML) return htmlUtils;
if (language === Note.MARKUP_LANGUAGE_MARKDOWN) return markdownUtils;
throw new Error('Unsupported markup language: ' + language);
}
extractImageUrls(language, text) {
return this.lib_(language).extractImageUrls(text);
}
}
const markupLanguageUtils = new MarkupLanguageUtils();
2019-07-29 15:43:53 +02:00
module.exports = markupLanguageUtils;