Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror return or line break in shipping / payment method description #12365

Open
RachL opened this issue Apr 11, 2024 · 2 comments · May be fixed by #12465
Open

Mirror return or line break in shipping / payment method description #12365

RachL opened this issue Apr 11, 2024 · 2 comments · May be fixed by #12465
Assignees
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. good first issue papercut Labels papercuts after they've moved from the "Papercuts prioritized" column

Comments

@RachL
Copy link
Contributor

RachL commented Apr 11, 2024

Description

When setting up a shipping or payment method description, users are allowed to return to line or add line breaks in the admin side.

However this is not done is the shopfront where everything is only separated with a space. If description are long this can be quite ugly.

Steps to Reproduce

  1. Add shipping method description with line breaks / return
  2. Checkout and observe the same description in shopfront

Animated Gif/Screenshot

Backoffice:

image

Shopfront:

image

Workaround

Some users are adding pipes or /// to separate their sentences.

Severity

bug-s3: a feature is broken but there is a workaround

Your Environment

  • Version used: v4.4.38
  • Browser name and version: Firefox and chrome
  • Operating System and version (desktop or mobile): both
@RachL RachL added good first issue bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. papercut Labels papercuts after they've moved from the "Papercuts prioritized" column labels Apr 11, 2024
@MrBowmanXD
Copy link

Tried using html_safe and raw in the shipping method description (checkout/_details.html.haml: line 98) but it doesn't work so my assumption is that the shipping method description is edited without the line breaks and return. Will delve deep into the code in order to know how the shipping method description is being saved.

@MrBowmanXD
Copy link

MrBowmanXD commented May 10, 2024

The simple format method resolves the issue. Don't know if it introduces errors or possibility of malicious code being introduced. https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M002285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. good first issue papercut Labels papercuts after they've moved from the "Papercuts prioritized" column
Projects
Status: In Progress ⚙
Status: To triage (By the maintainers)
Development

Successfully merging a pull request may close this issue.

2 participants