Skip to content
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

runfix: achieve WYSIWYG with lists and blockquotes markdown rendering [WPB-16228] #18850

Merged
merged 4 commits into from
Mar 10, 2025

Conversation

V-Gira
Copy link
Contributor

@V-Gira V-Gira commented Mar 10, 2025

BugWPB-16228 [Web] Fix quotes formatting

BugWPB-16229 [Web] Adding a line after list in richt text editor adds a tabulator when it should not

Description

There's a couple of discrepancies between markdown rendering in the input bar and the message list:

  • blockquotes are not correctly escaped in the input bar and appear in the message list
  • lists need an extra new line to be escaped, which is not represented in the input bar

Screenshots/Screencast (for UI changes)

before

Kooha-2025-03-10-14-40-23
Kooha-2025-03-10-14-42-20

after

Kooha-2025-03-10-14-33-23
Kooha-2025-03-10-14-38-04

Checklist

  • mentions the JIRA issue in the PR name (Ex. [WPB-XXXX])
  • PR has been self reviewed by the author;
  • Hard-to-understand areas of the code have been commented;
  • If it is a core feature, unit tests have been added;

@@ -129,6 +129,7 @@ const registerBlockquoteBackspaceCommand = (editor: LexicalEditor) => {
editor.update(() => {
lastChild.remove();
editor.dispatchCommand(INSERT_PARAGRAPH_COMMAND, undefined);
editor.dispatchCommand(INSERT_PARAGRAPH_COMMAND, undefined);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding an extra new line on backspace actually escape the blockquotes, and the added line is consistent with the message list md rendering

Comment on lines 255 to 261
// keep the list indentation for the next paragraph after the list
& + .editor-paragraph,
// and for every paragraph with text with a parent with text
// the ltr class is present for a paragraph with left-to-right text
& ~ .ltr + .ltr {
margin-left: 24px;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

css spaghetti here.
lexical does not keep the next paragraph after a list in the ul, but markdownit does (it's standard md).

the css is for keeping the list indentation for a single paragraph after a list, and every paragraph after that that contain text (the ltr class is added by lexical to paragraphs with left-to-right text)

@V-Gira V-Gira changed the title runfix: acheve WYSIWYG with lists and blockquotes markdown rendering [WPB-16228] runfix: achieve WYSIWYG with lists and blockquotes markdown rendering [WPB-16228] Mar 10, 2025
@V-Gira V-Gira merged commit ab91fc2 into dev Mar 10, 2025
13 of 15 checks passed
@V-Gira V-Gira deleted the v/markdown-rendering branch March 10, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants