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

Desktop: add option to use soft breaks for markdown rendering (#1408)

* add option to use soft breaks for markdown rendering

* oops, I didn't use the British spelling

* moved setting to section Plugins

* change text -> Enable soft breaks
This commit is contained in:
Helmut K. C. Tessarek
2019-04-21 05:03:10 -04:00
committed by Laurent Cozic
parent 220f5d0967
commit 12ebf44e22
2 changed files with 4 additions and 1 deletions

View File

@@ -52,6 +52,8 @@ class MdToHtml {
if (!options.paddingBottom) options.paddingBottom = '0';
if (!options.highlightedKeywords) options.highlightedKeywords = [];
const breaks_ = Setting.value('markdown.softbreaks') ? false : true;
const cacheKey = md5(escape(body + JSON.stringify(options) + JSON.stringify(style)));
const cachedOutput = this.cachedOutputs_[cacheKey];
if (cachedOutput) return cachedOutput;
@@ -63,7 +65,7 @@ class MdToHtml {
};
const markdownIt = new MarkdownIt({
breaks: true,
breaks: breaks_,
linkify: true,
html: true,
highlight: function(str, lang) {