From 8f9ac33649e4d711ad2d39cd8994fe9c824a9902 Mon Sep 17 00:00:00 2001 From: Thorsten Claus Date: Sun, 22 Aug 2021 18:22:58 +0200 Subject: [PATCH] Using shared markdown options for plain text fixes #7960 closes #8277 --- Changelog.md | 1 + lib/diaspora/message_renderer.rb | 12 +++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Changelog.md b/Changelog.md index 64acd3d04..48d7aab0a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -14,6 +14,7 @@ * Add tags to tumblr posts [#8244](https://github.com/diaspora/diaspora/pull/8244) * Add blocks to the archive export [#8263](https://github.com/diaspora/diaspora/pull/8263) * Allow points and dashes in the username [#8266](https://github.com/diaspora/diaspora/pull/8266) +* Add support for footnotes in markdown [#8277](https://github.com/diaspora/diaspora/pull/8277) # 0.7.15.0 diff --git a/lib/diaspora/message_renderer.rb b/lib/diaspora/message_renderer.rb index 84176d72f..d3f0e0232 100644 --- a/lib/diaspora/message_renderer.rb +++ b/lib/diaspora/message_renderer.rb @@ -50,7 +50,9 @@ module Diaspora end def strip_markdown - renderer = Redcarpet::Markdown.new Redcarpet::Render::StripDown, options[:stripdown_options] + # Footnotes are not supported in text-only outputs (mail, crossposts etc) + stripdown_options = options[:markdown_options].except(:footnotes) + renderer = Redcarpet::Markdown.new Redcarpet::Render::StripDown, stripdown_options @message = renderer.render(message).strip end @@ -114,14 +116,6 @@ module Diaspora squish: false, escape: true, escape_tags: false, - stripdown_options: { - autolink: true, - fenced_code_blocks: true, - space_after_headers: true, - strikethrough: true, - tables: true, - no_intra_emphasis: true - }, markdown_options: { autolink: true, fenced_code_blocks: true,