flarum / flarum/issue-archive

[Markdown] Newline in post is a character too late when a code block is used

Open
#259 4 comments 0 reactions 0 assignees View on GitHub
good first issue needs-verification type/bug
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Current Behavior**
The codeblock causes a post to have a horizontal scroll bar on mobile when added as the last part of a line.

**Steps to Reproduce**
1. Add a code block to a post which ends at the last character in a line (the "`" character is one character past where the new line should be)

**Expected Behavior**
The code block is moved to a new line

**Screenshots**
[![](https://i.imgur.com/lqpzHz2.jpg)](https://imgur.com/a/4sHph5X)

**Environment**
- Website URL: https://discuss.flarum.org
- Browser: Chrome 71 mobile

**Additional Context**
You can see the bug here: https://discuss.flarum.org/d/11006-twofactor-by-reflar/34

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the linked discussion using Chrome 71 mobile, with a post whose final content is a code block. Start by tracing the Markdown rendering for code blocks and verify that the block moves to a new line without creating horizontal scrolling; done means the expected line break appears on mobile.

Written by the indexing model from the issue text.

Assessment

Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.