File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,25 @@ def convert(content)
9797
9898class Jekyll ::Tags ::HighlightBlock
9999 alias render_rouge_without_ghpages_hack render_rouge
100+ alias render_without_ghpages_hack render
101+
102+ def render ( context )
103+ @render_ghpages_hack_context = context
104+ render_without_ghpages_hack ( context )
105+ end
100106
101107 def render_rouge ( context )
102- render_rouge_without_ghpages_hack ( context )
103- . gsub ( /\r ?\n / , "<br data-jekyll-commonmark-ghpages>" )
108+ rendered = render_rouge_without_ghpages_hack ( context )
109+
110+ processor = @render_ghpages_hack_context
111+ . registers [ :site ]
112+ . find_converter_instance ( Jekyll ::Converters ::Markdown )
113+ . get_processor
114+
115+ if processor . is_a? ( Jekyll ::Converters ::Markdown ::CommonMarkGhPages )
116+ rendered . gsub! ( /\r ?\n / , "<br data-jekyll-commonmark-ghpages>" )
117+ end
118+
119+ rendered
104120 end
105121end
You can’t perform that action at this time.
0 commit comments