-
Notifications
You must be signed in to change notification settings - Fork 590
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
Line breaks don't work inside <pre>
tags in rich text widget
#4288
Comments
Thanks for the bug report. The rich text widget loads the Tiptap codeblock extensions, but for some reason, it doesn't recognize a return inside. Just an FYI - Tiptap kinda implements Markdown. In this case, once you toggle a codeblock on with three backticks or tilde, you should be able to use a plain return and stay in the block. You need to use three returns or a down arrow to get out of the block (if it is working correctly). |
@BoDonkey Thank you for the quick response. I've tried with the Markdown way using the three backticks but there is the same problem. Pressing ⏎ creates a space and ⇧ + ⏎ creates a new paragraph. |
It's worth checking the official tiptap sandboxes to see if they also have this problem. If not we may have broken something with a custom paragraph tag. |
@tomtuv Sorry - should have been clearer in my earlier comment. You are correct, something is broken. When it is fixed, you should only need to hit return to create a new line still within the code fence. |
To solve the issue where line breaks inside a Wrap the content inside the Here's an example <div>
<pre>
Your preformatted text here
</pre>
</div> By wrapping the |
How strange. I wonder why this is necessary. We might be able to do it just while in the editor, stripping out and restoring the divs as we save and reload the editor. |
Please note that this is a simplified, conceptual solution, and the exact implementation will depend on the rich text editor library you're using and its API. In practice, you would need to adapt this to your specific development environment.
|
That's actually a pretty long way from how Tiptap does things. Your first observation may be relevant to Tiptap but the second would be difficult to apply. |
To Reproduce
Step by step instructions to reproduce the behavior:
<pre>
style or create one using the Markdown shortcut```
Expected behavior
A new line break should be created inside the same
<pre>
element.Describe the bug
Line breaks work fine inside
<p>
tags using ⇧ + ⏎ but when inside<pre>
tags, it creates a new paragraph.Details
Version of Node.js:
16.20.1
Server Operating System:
Linux
Additional context:
The bug is present in all browsers.
Screenshots
The text was updated successfully, but these errors were encountered: