apostrophecms / apostrophecms/apostrophe

Line breaks don't work inside `<pre>` tags in rich text widget

Open
#4,288 10 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
4.6k
Forks
650
Avg merge
19h 21m
Merged PRs (30d)
23

Description

## To Reproduce

Step by step instructions to reproduce the behavior:

1. Add a new rich text widget
2. Select a custom `

` style or create one using the Markdown shortcut ```

3. Press +
4. A new paragraph is created instead of a line break

## Expected behavior
A new line break should be created inside the same `

` element.

## Describe the bug
Line breaks work fine inside `

` tags using + but when inside `

` 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**
Screenshot of the rich text widget with a `<pre>` element

Contributor guide

Open the contributing guide

Research direction

No file or test is named in the issue. Start by locating the rich text widget's handling of Shift+Enter and its special handling for pre elements, then reproduce the steps in a browser. Done means Shift+Enter creates a line break inside the same pre element rather than a new paragraph.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.