Skip to content

Conversation

martin-lysk
Copy link
Collaborator

@martin-lysk martin-lysk commented Apr 16, 2025

This pr introduces a serailization that allows to serailize whitespaces comming from plate lossless into markdown.

Markdown whitespace handling is a beast - two \n represent a paragraph but following ones get collapsed.

Mardkown Gets rendered as
Hello



new paragraph

Hello

new paragraph

empty paragraph paragraph with one softbreak paragraph with two softbreak

Hello


new paragraph

Hello


new paragraph

Hello



new paragraph

Hello

<br />

new paragraph
Hello

<p><br /></p>

new paragraph
Hello

\
<br />

new paragraph

Checklist

  • yarn typecheck
  • yarn lint:fix
  • yarn test
  • yarn brl
  • yarn changeset
  • ui changelog

Copy link

codesandbox bot commented Apr 16, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented Apr 16, 2025

🦋 Changeset detected

Latest commit: 4ad877f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@udecode/plate-markdown Patch
@udecode/plate-ai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plate ❌ Failed (Inspect) Apr 16, 2025 3:59pm

@martin-lysk martin-lysk marked this pull request as ready for review April 16, 2025 13:27
@martin-lysk martin-lysk marked this pull request as ready for review April 16, 2025 15:52
@martin-lysk martin-lysk marked this pull request as draft April 17, 2025 08:55
@martin-lysk
Copy link
Collaborator Author

This PR is still in draft - see discussion https://discord.com/channels/1026227597115396188/1080907882960277566/1361294241975767110

@12joan
Copy link
Collaborator

12joan commented Apr 17, 2025

Test

 

Test



Test


 

Test

X
Y

Test

@martin-lysk
Copy link
Collaborator Author

martin-lysk commented May 5, 2025

Paragraph with various soft linebreaks:

<br />br before the first non whitespace character  
Linebreak after first non whitespace Character  
The last softbreak:<br />&nbsp;


br before the first non whitespace character
Linebreak after first non whitespace Character
The last softbreak:
 

"Empty" paragraph using <br />:


<br /> following paragraph

Empty paragraph using <br />&nbsp;:


 

<br />&nbsp; following paragraph

Empty paragraph <p></p>:

<p></p> following paragraph

Empty paragraph <p><br /></p>:


<p><br /></p> following paragraph

Empty paragraph &nbsp;:

 

&nbsp; following paragraph

Empty paragraph &#xfeff;:



&#xfeff; following paragraph

Non Empty paragraph:

non empty

Non empty paragaph following paragraph

@zbeyens zbeyens added the stale label Jun 29, 2025
@zbeyens zbeyens closed this Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants