Skip to content

Commit a158984

Browse files
committed
markdown: use commonmarker as markdown processor
1 parent f8cb15b commit a158984

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ gem "bridgetown-svg-inliner", "~> 2.0"
4343
gem "bridgetown-sitemap", "~> 2.0"
4444

4545
gem "bridgetown-seo-tag", "~> 6.0"
46+
47+
gem "commonmarker"

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ GEM
5454
bridgetown (>= 1.2.0, < 2.0)
5555
nokogiri
5656
colorator (1.1.0)
57+
commonmarker (0.23.10)
5758
concurrent-ruby (1.2.2)
5859
erubi (1.12.0)
5960
faraday (2.7.10)
@@ -121,6 +122,7 @@ DEPENDENCIES
121122
bridgetown-seo-tag (~> 6.0)
122123
bridgetown-sitemap (~> 2.0)
123124
bridgetown-svg-inliner (~> 2.0)
125+
commonmarker
124126
puma (< 7)
125127

126128
BUNDLED WITH

bridgetown.config.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,4 @@ collections:
5050
output: true
5151
future: true
5252

53-
kramdown:
54-
parse_html_blocks: true
55-
56-
markdown: CustomMarkdownConverter
53+
markdown: Commonmarker
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Bridgetown::Converters::Markdown::Commonmarker
2+
def initialize(config)
3+
require "commonmarker"
4+
@config = config
5+
rescue LoadError
6+
STDERR.puts 'You are missing a library required for Markdown. Please run:'
7+
STDERR.puts ' $ [sudo] gem install commonmarker'
8+
raise RuntimeError.new("Missing dependency: commonmarker")
9+
end
10+
11+
def convert(content)
12+
CommonMarker.render_html(content)
13+
end
14+
end

plugins/converters/markdown/custom_markdown_converter.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)