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

fix(NcRichText) - keep newlines in rendered Markdown #4461

Merged
merged 1 commit into from Aug 24, 2023

Conversation

Antreesy
Copy link
Contributor

@Antreesy Antreesy commented Aug 24, 2023

☑️ Resolves

  • Markdown eats newlines (Enter, Shift+Enter), because rendered <span/> element doesn't contain symbols, so it's height === 0
  • For newline (several \n\n in a row) - we paste no-break space (unicode \u00A0) between to fill the line
  • Also replaced strikethrough with inline code, as we don't support it yet

🖼️ Screenshots

🏚️ Before

Screencast.from.24.08.2023.14.27.11.webm

🏡 After

Screencast.from.24.08.2023.14.26.17.webm

🚧 Tasks

  • ...

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy added this to the 8.0.0 milestone Aug 24, 2023
@Antreesy Antreesy self-assigned this Aug 24, 2023
@nickvergessen
Copy link
Contributor

/backport to stable7

Copy link
Contributor

@DorraJaouad DorraJaouad left a comment

Choose a reason for hiding this comment

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

Tested 👍

@nickvergessen nickvergessen merged commit 2f1f706 into master Aug 24, 2023
16 checks passed
@nickvergessen nickvergessen deleted the fix/noid/keep-newlines-markdown branch August 24, 2023 12:40
@Pytal Pytal added the bug Something isn't working label Aug 25, 2023
@Pytal
Copy link
Contributor

Pytal commented Aug 25, 2023

Adding label for auto-generated release notes

@dartcafe
Copy link
Contributor

Not sure, if this matches the normal (official?) markdown bevahior:

  • an empty line should create a paragraph <p></p> around the previous lines
  • a simple line break <br> is created while adding two spaces at the end of a line (sometimes with a backslash or <br>)

Fair enough: Normal users will not be aware of the 'two spaces at the end of a line' thing. But at least the paragraph renderimg makes sense.

@Antreesy
Copy link
Contributor Author

It's a workaround because of active rule white-space-collapse: collapse

Described by you behavior seems to match the current state:
image

@dartcafe
Copy link
Contributor

The span tags are there for a reason? They look weird and unusual.

@Antreesy
Copy link
Contributor Author

Thought the same, but it's a result of current parsing process. They probably could be removed, but with some deep changes I wouldn't like to touch for a moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants