mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Avoid line-break by wrapping into nowrap element
This commit is contained in:
@@ -28,7 +28,8 @@ module Spree
|
||||
end
|
||||
|
||||
def to_html(options = { html_wrap: true })
|
||||
@money.format(@options.merge(options)).html_safe
|
||||
"<span style='white-space: nowrap;'>#{@money.format(@options.merge(options))}</span>"
|
||||
.html_safe
|
||||
end
|
||||
|
||||
def format(options = {})
|
||||
|
||||
@@ -123,7 +123,7 @@ describe Spree::Money do
|
||||
money = Spree::Money.new(10)
|
||||
# The HTMLified version of the euro sign
|
||||
expect(money.to_html).to eq(
|
||||
"<span class=\"money-whole\">10</span><span class=\"money-decimal-mark\">.</span><span class=\"money-decimal\">00</span> <span class=\"money-currency-symbol\">€</span>"
|
||||
"<span style='white-space: nowrap;'><span class=\"money-whole\">10</span><span class=\"money-decimal-mark\">.</span><span class=\"money-decimal\">00</span> <span class=\"money-currency-symbol\">€</span></span>"
|
||||
)
|
||||
end
|
||||
# rubocop:enable Layout/LineLength
|
||||
|
||||
Reference in New Issue
Block a user