Skip to content

Commit

Permalink
Force Pandoc to return UTF8
Browse files Browse the repository at this point in the history
  • Loading branch information
rkent committed Sep 10, 2024
1 parent 1fa06cd commit 0302d86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _ruby_libs/text_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# Converts RST to Markdown
def rst_to_md(rst)
begin
return PandocRuby.convert(rst, :from => :rst, :to => :markdown)
# For some reason, Pandoc is converting UTF-8 into ASCII which then kills kramdown
return PandocRuby.convert(rst, :from => :rst, :to => :markdown).force_encoding(Encoding::UTF_8)
rescue Exception => e
return "Could not convert RST to MD: "+e.to_s
end
Expand Down

0 comments on commit 0302d86

Please sign in to comment.