1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: Refactor Markdown rendering (#1315)

* Refactoring MdToHtml to avoid manually rendering tokens

* Minor fix

* Fixed loading of resources

* Handle clicking on checkboxes

* Added back Katex support

* Fixed issues with Katex and note rendering

* Added back support for links

* Restored code block highlighting support

* clean up

* Applying update to mobile

* Fixed handling of links and cleaned up to share more code between mobile and desktop

* Restored content caching and improved handling of additional assets

* Clean up and a few fixes

* Applied more updates to mobile and added code highlighting support
This commit is contained in:
Laurent Cozic
2019-03-08 17:14:17 +00:00
committed by GitHub
parent 5719ae495a
commit 9289dbdf77
42 changed files with 1223 additions and 1468 deletions

View File

@ -13,7 +13,12 @@ const { uuid } = require('lib/uuid.js');
const Resource = require('lib/models/Resource');
const injectedJs = {
mermaid: require('lib/rnInjectedJs/mermaid'),
webviewLib: require('lib/rnInjectedJs/webviewLib'),
};
const cssToJs = {
'hljs-atom-one-dark-reasonable.css': require('lib/csstojs/hljs-atom-one-dark-reasonable.css.js'),
'hljs-atom-one-light.css': require('lib/csstojs/hljs-atom-one-light.css.js'),
};
function shimInit() {
@ -169,8 +174,13 @@ function shimInit() {
}
shim.injectedJs = function(name) {
if (name in injectedJs) return injectedJs[name];
return '';
if (!(name in injectedJs)) throw new Error('Cannot find injectedJs file (add it to "injectedJs" object): ' + name);
return injectedJs[name];
}
shim.loadCssFromJs = function(name) {
if (!(name in cssToJs)) throw new Error('Cannot find csstojs file (add it to "cssToJs" object): ' + name);
return cssToJs[name];
}
}