From 996d4674e06be8cb030f25c30b7a0239c1f47130 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Sun, 30 Jun 2024 21:40:51 +0200 Subject: [PATCH] Disable footnote backlinks in Markdown These backlinks don't work reliably and are thus more harmful than useful. --- app/helpers/application_helper.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9aa67845..f10aa7c2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -50,7 +50,13 @@ module ApplicationHelper end def render_markdown(markdown) - ActionController::Base.helpers.sanitize Kramdown::Document.new(markdown, input: 'GFM', hard_wrap: false, smart_quotes: 'apos,apos,quot,quot').to_html.strip + ActionController::Base.helpers.sanitize Kramdown::Document.new( + markdown, + input: 'GFM', + hard_wrap: false, + smart_quotes: 'apos,apos,quot,quot', + footnote_backlink: nil + ).to_html.strip end def row(options = {}, &block)