Merge pull request #11105 from jibees/11098-summary-step-order-details-line-break-on-currency-symbol-and-lettering

Checkout summary: avoid carriage return on price
This commit is contained in:
Konrad
2023-07-19 13:00:08 +02:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -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 = {})

View File

@@ -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\">&#x20AC;</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\">&#x20AC;</span></span>"
)
end
# rubocop:enable Layout/LineLength