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

Wrapping multiline text in markdown editor #11076

Open
andreas-eisenmann opened this issue Nov 6, 2024 · 0 comments
Open

Wrapping multiline text in markdown editor #11076

andreas-eisenmann opened this issue Nov 6, 2024 · 0 comments

Comments

@andreas-eisenmann
Copy link

Bug description

Our customer found two issues when trying to wrap multiline text in the markdown editor:

Toggle issue

  • Insert a field of the markdown fieldtype in a blueprint
  • Add some text inside the markdown editor with line breaks,
  • Mark this text with line breaks and toggle e.g. "bold" or "italic"
  • Toggling doesn't work, the marked text will be wrapped again and again e.g. with **

Have a look:

Peek_2024-11-06_20-49

I think the root cause lies here:

The RegEx pattern /^\*{2}(.*)\*{2}$/ doesn't match multiline text. If you add the ms flags, everything works fine:

Peek_2024-11-06_20-54

New RegEx pattern: /^\*{2}(.*)\*{2}$/ms.

Empty line at the end of the text

If you mark an empty line at the end of the text (or paragraph) to wrap, the empty line is also being wrapped, so there will be a line at the end of the paragraph which only contains e.g. **. This won't be rendered as expected in the frontend. So you have to be veeery very careful which lines have to marked and which lines should not. It's very easy to mark too much by mistake. This is really annoying. Is it possible to "trim" the marked text block which should be wrapped e.g. by ** when applying bold mode?

Peek_2024-11-06_20-59

How to reproduce

See description.

Logs

No response

Environment

Environment
Application Name: **************
Laravel Version: 10.48.22
PHP Version: 8.2.12
Composer Version: 2.6.5
Environment: local
Debug Mode: ENABLED
URL: localhost
Maintenance Mode: OFF

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

Drivers
Broadcasting: log
Cache: statamic
Database: pgsql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Locales
Installed
Locales Version: 1.9.0
Protected

Localization
Installed: de, en
LaravelLang\Attributes\Plugin: 2.9.4
LaravelLang\HttpStatuses\Plugin: 3.8.2
LaravelLang\Lang\Plugin: 13.12.0
Protected Locales: de, en
Publisher Version: 14.7.1

Livewire
Livewire: v3.5.4

Statamic
Addons: 3
Antlers: runtime
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.53.2 PRO

Statamic Addons
anakadote/statamic-recaptcha: 1.0.14
statamic-rad-pack/runway: 6.6.2
statamic/eloquent-driver: 3.3.3

Statamic Eloquent Driver
Asset Containers: eloquent
Assets: eloquent
Blueprints: eloquent
Collection Trees: eloquent
Collections: eloquent
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: eloquent
Revisions: eloquent
Taxonomies: eloquent
Terms: eloquent

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

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

No branches or pull requests

2 participants