StackExchange / StackExchange/Stacks-Editor

RT mode displays weirdly content made from HTML paragraph and HTML comment tags

Open
#207 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug html mode - rich text
Dominant language
TypeScript
Stars
437
Forks
61
Avg merge
16h 2m
Merged PRs (30d)
8

Description

Describe the bug
A combination of HTML p tag and comment tag in the MD mode are display weirdly in RT mode:

  • The p content is overlapped with the editor empty state's placeholder text
  • The text is wrapped in a blue border box
  • The text is uneditable. Inserting new words make the whole text be removed.
  • Even back to the MD mode to remove the HTML comment, the issue is still remaining.

To Reproduce
Steps to reproduce the behavior:

  1. In MD mode, insert this:
<p>A paragraph.</p>
<!--This is a comment -->
  1. Back to RT mode and see the error:
    image

Expected behavior
The RT display shouldn't be affected by the HTML comment tag. Display p tag element with or without HTML comment should be the same.

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version 103.0.5060.114 (Official Build) (arm64)

Additional context
I also reported the issue in the Feedback Stack editor thread here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the Stacks Editor: enter the provided paragraph and HTML comment in MD mode, then switch to RT mode and test editing and removal of the comment. Done means the paragraph renders identically with or without the comment and remains editable without placeholder overlap or the blue border.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
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.