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

Shopfront: Force product description to be on one line #10538

Conversation

jibees
Copy link
Contributor

@jibees jibees commented Mar 9, 2023

What? Why?

Capture d’écran 2023-03-09 à 12 07 29

What should we test?

  • As an admin, edit a product description with formatting and line breaks
  • As a shopper, see that product description in the shop has formatting + is only on one line
    (This should be tested in both Safari and another major browser. And on mobile phones.)

Release notes

Changelog Category: User facing changes

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

@jibees jibees self-assigned this Mar 9, 2023
@RachL RachL self-assigned this Mar 21, 2023
@RachL RachL added the pr-staged-fr staging.coopcircuits.fr label Mar 21, 2023
@RachL
Copy link
Contributor

RachL commented Mar 21, 2023

Before :

image

image

after:

image

image

sooo I guess I copied some blank spaces. But thing is (as we don't allow the user to see the html source #trolling ) I have no way of removing it.

image

@jibees any clue on how to fix this? Here is the text I have used: https://www.loremipzum.com/fr/g%C3%A9n%C3%A9rateur-de-texte

Moving back in dev for now.

@RachL RachL removed the pr-staged-fr staging.coopcircuits.fr label Mar 21, 2023
@jibees jibees force-pushed the 10537-shopfront-product-description-is-too-long branch from 6b79dbc to d56ae05 Compare March 22, 2023 08:58
@jibees
Copy link
Contributor Author

jibees commented Mar 22, 2023

Yeap, you're right, that's because, during the copy/paste they're some extra and empty <p /> that have been included.
I cannot reproduce using you're website (pretty good actually, as you can HTML formatting and links...), but I think I know enough to fix this.

Capture d’écran 2023-03-22 à 10 05 06

@jibees jibees force-pushed the 10537-shopfront-product-description-is-too-long branch from d56ae05 to 1de9f5a Compare March 23, 2023 09:31
@jibees jibees force-pushed the 10537-shopfront-product-description-is-too-long branch from 1de9f5a to 4dfc569 Compare March 31, 2023 08:41
Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix!
I wonder if we could also remove other empty nodes, but that's not necessary because none of the other types result in new lines.

This should be tested in both Safari and another major browser. Also on an Apple phone if possible, or emulate it on a computer.

@RachL RachL added the pr-staged-fr staging.coopcircuits.fr label Apr 5, 2023
@RachL
Copy link
Contributor

RachL commented Apr 5, 2023

Before:

image

after:
image

Bold italic etc still work as well:

image

this looks good to me! thanks @jibees merging :)

@RachL RachL merged commit 3e5becf into openfoodfoundation:master Apr 5, 2023
@RachL RachL removed the pr-staged-fr staging.coopcircuits.fr label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shopfront: product description is too long
5 participants