fix kramdown using curved quotes and replace them with straight quotation marks
This commit is contained in:
@ -835,7 +835,7 @@
|
|||||||
|
|
||||||
var prevTime = new Date().getTime();
|
var prevTime = new Date().getTime();
|
||||||
|
|
||||||
text = converter.makeHtml(text);
|
text = converter.makeHtml(text).replaceAll(/“|”/g, '"');
|
||||||
|
|
||||||
// Calculate the processing time of the HTML creation.
|
// Calculate the processing time of the HTML creation.
|
||||||
// It's used as the delay time in the event listener.
|
// It's used as the delay time in the event listener.
|
||||||
|
@ -50,7 +50,7 @@ module ApplicationHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def render_markdown(markdown)
|
def render_markdown(markdown)
|
||||||
ActionController::Base.helpers.sanitize Kramdown::Document.new(markdown, input: 'GFM', hard_wrap: false).to_html.strip
|
ActionController::Base.helpers.sanitize Kramdown::Document.new(markdown, input: 'GFM', hard_wrap: false, smart_quotes: 'apos,apos,quot,quot').to_html.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
def row(options = {}, &block)
|
def row(options = {}, &block)
|
||||||
|
@ -314,7 +314,7 @@ class Submission < ApplicationRecord
|
|||||||
else
|
else
|
||||||
# The render_markdown method from application_helper.rb is not available in model classes.
|
# The render_markdown method from application_helper.rb is not available in model classes.
|
||||||
ActionController::Base.helpers.sanitize(
|
ActionController::Base.helpers.sanitize(
|
||||||
Kramdown::Document.new(file.feedback_message).to_html,
|
Kramdown::Document.new(file.feedback_message, smart_quotes: 'apos,apos,quot,quot').to_html,
|
||||||
tags: %w[strong],
|
tags: %w[strong],
|
||||||
attributes: []
|
attributes: []
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user