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

Paragraph whitespace stripping in bard field #10847

Open
LorensoD opened this issue Sep 26, 2024 · 3 comments
Open

Paragraph whitespace stripping in bard field #10847

LorensoD opened this issue Sep 26, 2024 · 3 comments
Labels

Comments

@LorensoD
Copy link

Bug description

After upgrading to Statamic 5, I’ve encountered an issue where the Bard field is stripping whitespace in certain situations. Specifically, when using bold text or hyperlinks within a paragraph, the spaces before and after the formatted text are removed, causing words to run together.

Bard field before saving:
image

Html source before saving:
image

Bard field after saving:
image

Html source after saving:
image

How to reproduce

  1. Create or edit an entry with a Bard field.
  2. Type a paragraph of text.
  3. Within the paragraph, select a word or phrase in the middle and apply bold formatting or insert a link.
  4. Save the entry.
  5. View the published content or revisit the editor.

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.21.0
PHP Version: 8.3.11
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: --
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: redis
Session: redis

Sentry
Enabled: MISSING DSN
Environment: local
Laravel SDK Version: 4.8.0
PHP SDK Version: 4.9.0
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: NOT SET
Sample Rate Profiling: NOT SET
Send Default PII: DISABLED

Statamic
Addons: 2
Sites: 4 (Dutch, English, German, French)
Stache Watcher: Enabled
Static Caching: full
Version: 5.26.0 PRO

Statamic Addons
webographen/statamic-widget-continue-editing: 1.3.2
withcandour/aardvark-seo: 5.0.0

Installation

Fresh statamic/statamic site via CLI

Additional details

I use sets in my bard field.
The bard field does not Save as HTML.

@LorensoD LorensoD changed the title Paragraph Whitespace Stripping in Bard Field Paragraph whitespace stripping in bard field Sep 26, 2024
@duncanmcclean
Copy link
Member

Is this happening on the frontend too, or just when you view the source HTML in the Bard editor?

@LorensoD
Copy link
Author

Is this happening on the frontend too, or just when you view the source HTML in the Bard editor?

I'm using the Rest API. And there the rendered html in the json response is also missing whitespace.

@LorensoD
Copy link
Author

After the V5 upgrade when I save a page with Bard fields, without making any content changes, it results in the whitespace being stripped. I get this change in the markdown/yaml content file of the page:

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants