This commit is contained in:
24c02 2025-02-07 18:12:01 -05:00
parent bc764dd72b
commit 1edf2f95a9

View file

@ -35,8 +35,9 @@ module Sinatra
text
end
end
def md(markdown)
(@renderer ||= Redcarpet::Markdown.new(SVFlavoredMarkdown.new(link_attributes: {target: '_blank'}), autolink: true, tables: true)).render(markdown)
(@renderer ||= Redcarpet::Markdown.new(SVFlavoredMarkdown.new(link_attributes: { target: '_blank' }), autolink: true, tables: true)).render(markdown)
end
end
module SchmoneyHelper
@ -45,7 +46,7 @@ module Sinatra
end
end
module IIHelper
def render_ii(shipment, field, emoji, description, representation=nil, nilify=true)
def render_ii(shipment, field, emoji, description, representation = nil, nilify = true)
return unless shipment[field]
return if nilify && shipment[field] == 0
"<br/><abbr title='#{description}'>#{emoji}</abbr>: #{representation&.call(shipment) || shipment[field]}"