1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Plugins: Added a renderMarkup command to render MD or HTML markup to HTML

This commit is contained in:
Laurent Cozic
2024-10-27 21:19:38 +00:00
parent a2d0908eb6
commit ff09937ca2
14 changed files with 91 additions and 51 deletions

View File

@ -0,0 +1,21 @@
import { MarkupLanguageUtils as BaseMarkupLanguageUtils } from '../markupLanguageUtils';
import { PluginStates } from '../services/plugins/reducer';
import { contentScriptsToRendererRules } from '../services/plugins/utils/loadContentScripts';
import { Options } from '@joplin/renderer/MarkupToHtml';
class MarkupLanguageUtils extends BaseMarkupLanguageUtils {
public newMarkupToHtml(plugins: PluginStates = null, options: Options = null) {
plugins = plugins || {};
return super.newMarkupToHtml(null, {
extraRendererRules: contentScriptsToRendererRules(plugins),
...options,
});
}
}
const markupLanguageUtils = new MarkupLanguageUtils();
export default markupLanguageUtils;