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

All: Extract note renderer to separate package (WIP) (#2206)

* Started updating to use external renderer package

* Added way to build renderer assets

* Done mobile compatilibty

* Upgrade joplin-renderer

* Added joplin-renderer package
This commit is contained in:
Laurent Cozic
2019-12-29 18:58:40 +01:00
committed by GitHub
parent 1d660d7141
commit 2a63ecef2a
63 changed files with 1130 additions and 3672 deletions

View File

@ -11,6 +11,7 @@ const { _ } = require('lib/locale.js');
const ArrayUtils = require('lib/ArrayUtils.js');
const lodash = require('lodash');
const urlUtils = require('lib/urlUtils.js');
const { MarkupToHtml } = require('joplin-renderer');
class Note extends BaseItem {
static tableName() {
@ -624,8 +625,8 @@ class Note extends BaseItem {
}
static markupLanguageToLabel(markupLanguageId) {
if (markupLanguageId === Note.MARKUP_LANGUAGE_MARKDOWN) return 'Markdown';
if (markupLanguageId === Note.MARKUP_LANGUAGE_HTML) return 'HTML';
if (markupLanguageId === MarkupToHtml.MARKUP_LANGUAGE_MARKDOWN) return 'Markdown';
if (markupLanguageId === MarkupToHtml.MARKUP_LANGUAGE_HTML) return 'HTML';
throw new Error(`Invalid markup language ID: ${markupLanguageId}`);
}
}
@ -633,7 +634,4 @@ class Note extends BaseItem {
Note.updateGeolocationEnabled_ = true;
Note.geolocationUpdating_ = false;
Note.MARKUP_LANGUAGE_MARKDOWN = 1;
Note.MARKUP_LANGUAGE_HTML = 2;
module.exports = Note;