Skip to content

Commit 64b2746

Browse files
committed
Switch from redcarpet to kramdown for markdown rendering
redcarpet can't deal with pipes in tables vmg/redcarpet#477
1 parent 8930282 commit 64b2746

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

scripts/build

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ gemfile do
77
source 'https://rubygems.org'
88
gem 'RedCloth', '~> 4.3.2'
99
gem 'ruby-handlebars', '~> 0.4.1'
10-
gem 'redcarpet', '~> 3.6.0'
10+
gem 'kramdown', '~> 2.4.0'
1111
end
1212
puts 'Gems installed and loaded.'
1313

@@ -121,16 +121,14 @@ textile_file_names.each do |file_name|
121121
puts "✓"
122122
end
123123

124-
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
125-
126124
markdown_file_names.each do |file_name|
127125
print "#{file_name} ... "
128126

129127
markdown_content = remove_frontmatter(File.read(File.join(SOURCE_PATH, file_name)))
130128
.gsub(/\{\{\s*SPECIFICATION_VERSION\s*\}\}/, versions['specification'].to_s)
131129
.gsub(/\{\{\s*PROTOCOL_VERSION\s*\}\}/, versions['protocol'].to_s)
132130

133-
bodyHtml = markdown.render(markdown_content)
131+
bodyHtml = Kramdown::Document.new(markdown_content).to_html
134132
plain_file_name = file_name.delete_suffix(MARKDOWN_EXTENSION)
135133
is_root = (plain_file_name == ROOT_SOURCE_NAME)
136134
html = template.call({

0 commit comments

Comments
 (0)