mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Clipper: Minor fixes
This commit is contained in:
parent
74ee629266
commit
c75618eb8f
@ -52,6 +52,7 @@ const htmlUtils = {
|
|||||||
|
|
||||||
for (const anchor of anchors) {
|
for (const anchor of anchors) {
|
||||||
const href = anchor.getAttribute('href');
|
const href = anchor.getAttribute('href');
|
||||||
|
if (!href) continue;
|
||||||
const newHref = urlUtils.prependBaseUrl(href, baseUrl);
|
const newHref = urlUtils.prependBaseUrl(href, baseUrl);
|
||||||
anchor.setAttribute('href', newHref);
|
anchor.setAttribute('href', newHref);
|
||||||
}
|
}
|
||||||
|
@ -437,9 +437,10 @@ class Api {
|
|||||||
if (requestNote.body_html) {
|
if (requestNote.body_html) {
|
||||||
if (requestNote.convert_to === 'html') {
|
if (requestNote.convert_to === 'html') {
|
||||||
const style = await this.buildNoteStyleSheet_(requestNote.stylesheets);
|
const style = await this.buildNoteStyleSheet_(requestNote.stylesheets);
|
||||||
|
const minify = require('html-minifier').minify;
|
||||||
|
|
||||||
const styleTag = style.length ? '<style>' + style.join('\n') + '</style>' + '\n' : '';
|
const styleTag = style.length ? '<style>' + style.join('\n') + '</style>' + '\n' : '';
|
||||||
|
|
||||||
const minify = require('html-minifier').minify;
|
|
||||||
output.body = minify(styleTag + requestNote.body_html, {
|
output.body = minify(styleTag + requestNote.body_html, {
|
||||||
// Remove all spaces and, especially, newlines from tag attributes, as that would
|
// Remove all spaces and, especially, newlines from tag attributes, as that would
|
||||||
// break the rendering.
|
// break the rendering.
|
||||||
@ -447,6 +448,7 @@ class Api {
|
|||||||
// Need to remove all whitespaces because whitespace at a beginning of a line
|
// Need to remove all whitespaces because whitespace at a beginning of a line
|
||||||
// means a code block in Markdown.
|
// means a code block in Markdown.
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
|
minifyCSS: true,
|
||||||
});
|
});
|
||||||
output.body = htmlUtils.prependBaseUrl(output.body, baseUrl);
|
output.body = htmlUtils.prependBaseUrl(output.body, baseUrl);
|
||||||
output.markup_language = Note.MARKUP_LANGUAGE_HTML;
|
output.markup_language = Note.MARKUP_LANGUAGE_HTML;
|
||||||
|
Loading…
Reference in New Issue
Block a user