From b62d5a603536d42e8f0c9b7cf493a0249d2bedc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Wed, 4 Nov 2026 17:36:19 +0400 Subject: [PATCH] Fix GFM markdown rendering in production kramdown-parser-gfm was only pulled in transitively by solargraph, which lives in the development group. Production installs therefore lacked the GFM parser, so rendering any rich-text content page raised "Kramdown::Error: kramdown has no parser to handle the specified input format: GFM". Declare kramdown-parser-gfm as a direct dependency and add a regression spec for ApplicationHelper#markdown_to_html. Fixes #264 --- Gemfile | 1 + Gemfile.lock | 1 + spec/helpers/application_helper_spec.rb | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/Gemfile b/Gemfile index e41a186..e2f1f58 100644 --- a/Gemfile +++ b/Gemfile @@ -43,6 +43,7 @@ gem 'flipper-ui' gem 'gpgme', '~> 2.0.24' gem 'zbase32', '~> 0.1.1' gem 'kramdown' +gem 'kramdown-parser-gfm' gem 'device_detector' # HTTP requests diff --git a/Gemfile.lock b/Gemfile.lock index 9838525..70cb8df 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -561,6 +561,7 @@ DEPENDENCIES importmap-rails jbuilder (~> 2.15) kramdown + kramdown-parser-gfm letter_opener letter_opener_web listen (~> 3.2) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index f9a8fb6..5a547f9 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -1,4 +1,13 @@ require 'rails_helper' describe ApplicationHelper do + describe "#markdown_to_html" do + it "renders GFM input" do + expect(helper.markdown_to_html("**bold**")).to include("bold") + end + + it "renders GFM-specific syntax" do + expect(helper.markdown_to_html("~~struck~~")).to include("struck") + end + end end -- 2.50.1