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

Add trim to user content template's text value #2901



Copy link

jessedobbelaere commented Sep 16, 2019


  • Enhancement

Resolves the following issues

When my user content template contains this (auto-formatted) html:

<h5 class="text-blue-darkest font-medium uppercase text-lg" data-ft-label="Naam" data-ft-type="text">
    Firstname Lastname

There are spaces in the html. However, these spaces are copied in the rendering of the field:


Pull request description

  • Add a trim() to the value of the user content text field html method
  • Use a ES6 Template Literals to return the snippet of HTML. We lose IE11 support by doing that, but I guess we should stop supporting IE11 in the backend? ⚠️ This is the backend and any admin is most likely using an evergreen browser? Should I make all the methods that return html in this class, use template literals?

After the fix: no added whitespace in the default values visible


@jessedobbelaere jessedobbelaere changed the title Bugfix: Add trim to user content template's text value Add trim to user content template's text value Sep 16, 2019

This comment has been minimized.

Copy link
Contributor Author

jessedobbelaere commented Sep 17, 2019

Possibly also needed for the textarea field?

src/Backend/Modules/Pages/Js/Pages.js Outdated Show resolved Hide resolved
Signed-off-by: Jesse Dobbelaere <>
@jessedobbelaere jessedobbelaere requested a review from carakas Sep 30, 2019
carakas approved these changes Oct 3, 2019
@carakas carakas added this to the 5.6.3 milestone Oct 3, 2019
@carakas carakas merged commit 44c7031 into forkcms:master Oct 3, 2019
3 checks passed
3 checks passed
Scrutinizer Analysis: No new issues – Tests: passed
continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed
@carakas carakas modified the milestones: 5.6.3, 5.7.0 Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.