1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop, Mobile: Fix TOC with special characters (#2052)

This commit is contained in:
Helmut K. C. Tessarek 2019-11-05 08:18:05 -05:00 committed by Laurent Cozic
parent 3cac187023
commit 83c3c027d0

View File

@ -28,9 +28,13 @@ const plugins = {
emoji: { module: require('markdown-it-emoji') },
insert: { module: require('markdown-it-ins') },
multitable: { module: require('markdown-it-multimd-table'), options: { enableMultilineRows: true, enableRowspan: true } },
toc: { module: require('markdown-it-toc-done-right'), options: { listType: 'ul' } },
toc: { module: require('markdown-it-toc-done-right'), options: { listType: 'ul', slugify: uslugify } },
};
function uslugify(s) {
return uslug(s);
}
class MdToHtml {
constructor(options = null) {
if (!options) options = {};
@ -145,9 +149,7 @@ class MdToHtml {
if (Setting.value('markdown.plugin.fountain')) markdownIt.use(rules.fountain(context, ruleOptions));
markdownIt.use(rules.highlight_keywords(context, ruleOptions));
markdownIt.use(rules.code_inline(context, ruleOptions));
markdownIt.use(markdownItAnchor, {
slugify: s => uslug(s),
});
markdownIt.use(markdownItAnchor, { slugify: uslugify });
for (let key in plugins) {
if (Setting.value(`markdown.plugin.${key}`)) markdownIt.use(plugins[key].module, plugins[key].options);