Skip to content

Commit 6986404

Browse files
committed
Move from github-markdown to github-markup
They are very similar gems, but the former isn't supported on newer versions of OSX. Basically you'll see an error like. ``` gh-markdown.c:56:29: error: implicitly declaring library function 'isspace' with type 'int (int)' [-Werror,-Wimplicit-function-declaration] while (i < lang->size && !isspace(lang->data[i])) ^ gh-markdown.c:56:29: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace' ``` Since the github-markdown gem is deprecated, we need to change gems.
1 parent 300b31c commit 6986404

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ gem 'faraday-http-cache'
3838
gem 'warden'
3939
gem 'active_hash'
4040
gem 'ansible'
41-
gem 'github-markdown'
41+
gem 'github-markup'
42+
gem 'commonmarker'
4243
gem 'coderay'
4344
gem 'net-http-persistent'
4445
gem 'concurrent-ruby'

Gemfile.lock

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ GEM
277277
thor (>= 0.18, < 2)
278278
byebug (8.2.2)
279279
coderay (1.1.1)
280+
commonmarker (0.21.1)
281+
ruby-enum (~> 0.5)
280282
concurrent-ruby (1.1.7)
281283
connection_pool (2.2.1)
282284
crack (0.4.3)
@@ -316,7 +318,7 @@ GEM
316318
forking_test_runner (1.2.0)
317319
parallel_tests (>= 1.3.7)
318320
git_diff_parser (3.1.0)
319-
github-markdown (0.6.9)
321+
github-markup (3.0.5)
320322
gitlab (4.10.0)
321323
httparty (~> 0.14, >= 0.14.0)
322324
terminal-table (~> 1.5, >= 1.5.1)
@@ -560,6 +562,8 @@ GEM
560562
rubocop-rails (2.3.2)
561563
rack (>= 1.1)
562564
rubocop (>= 0.72.0)
565+
ruby-enum (0.8.0)
566+
i18n
563567
ruby-progressbar (1.10.1)
564568
ruby_parser (3.13.1)
565569
sexp_processor (~> 4.9)
@@ -644,6 +648,7 @@ DEPENDENCIES
644648
bundler
645649
bundler-audit
646650
coderay
651+
commonmarker
647652
concurrent-ruby
648653
connection_pool
649654
dalli
@@ -656,7 +661,7 @@ DEPENDENCIES
656661
flay
657662
forking_test_runner
658663
gcloud_image_tagger!
659-
github-markdown
664+
github-markup
660665
goldiloader
661666
large_object_store
662667
lograge

app/helpers/application_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22
require 'ansible'
3-
require 'github/markdown'
3+
require 'github/markup'
44

55
module ApplicationHelper
66
BOOTSTRAP_FLASH_MAPPINGS = {
@@ -27,7 +27,7 @@ def autolink(text)
2727

2828
# https://github.com/showdownjs/showdown/wiki/Markdown's-XSS-Vulnerability-(and-how-to-mitigate-it)
2929
def markdown(str)
30-
sanitize GitHub::Markdown.render_gfm(str)
30+
sanitize GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, str)
3131
end
3232

3333
def deploy_link(project, stage)

0 commit comments

Comments
 (0)