You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-02 22:49:09 +02:00
Fixed tests
This commit is contained in:
@@ -226,14 +226,7 @@ class MdToHtml {
|
|||||||
const pluginAssets = this.processPluginAssets(context.pluginAssets);
|
const pluginAssets = this.processPluginAssets(context.pluginAssets);
|
||||||
cssStrings = cssStrings.concat(pluginAssets.cssStrings);
|
cssStrings = cssStrings.concat(pluginAssets.cssStrings);
|
||||||
|
|
||||||
if (options.userCss) cssStrings.push(options.userCss);
|
|
||||||
|
|
||||||
const styleHtml = `<style>${cssStrings.join('\n')}</style>`;
|
|
||||||
|
|
||||||
const html = `${styleHtml}<div id="rendered-md">${renderedBody}</div>`;
|
|
||||||
|
|
||||||
const output = {
|
const output = {
|
||||||
html: html,
|
|
||||||
pluginAssets: pluginAssets.files.map(f => {
|
pluginAssets: pluginAssets.files.map(f => {
|
||||||
return Object.assign({}, f, {
|
return Object.assign({}, f, {
|
||||||
path: `pluginAssets/${f.name}`,
|
path: `pluginAssets/${f.name}`,
|
||||||
@@ -241,6 +234,19 @@ class MdToHtml {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (options.bodyOnly) {
|
||||||
|
output.html = renderedBody;
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.userCss) cssStrings.push(options.userCss);
|
||||||
|
|
||||||
|
const styleHtml = `<style>${cssStrings.join('\n')}</style>`;
|
||||||
|
|
||||||
|
const html = `${styleHtml}<div id="rendered-md">${renderedBody}</div>`;
|
||||||
|
|
||||||
|
output.html = html;
|
||||||
|
|
||||||
// Fow now, we keep only the last entry in the cache
|
// Fow now, we keep only the last entry in the cache
|
||||||
this.cachedOutputs_ = {};
|
this.cachedOutputs_ = {};
|
||||||
this.cachedOutputs_[cacheKey] = output;
|
this.cachedOutputs_[cacheKey] = output;
|
||||||
|
|||||||
Reference in New Issue
Block a user