The RegEx pattern /^\*{2}(.*)\*{2}$/ doesn't match multiline text. If you add the ms flags, everything works fine:
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?
Bug description
Our customer found two issues when trying to wrap multiline text in the markdown editor:
Toggle issue
**
Have a look:
I think the root cause lies here:
https://github.com/statamic/cms/blob/f01281268ae2fec73d52954dc536998db7d9c2a1/resources/js/components/fieldtypes/markdown/MarkdownFieldtype.vue#L291
The RegEx pattern
/^\*{2}(.*)\*{2}$/
doesn't match multiline text. If you add thems
flags, everything works fine: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?How to reproduce
See description.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response