Open sklinov opened 3 years ago
same here. Getting \
for every empty block
I am seeing the same behavior, I haven't been able to figure out the cause.
This is expected behavior at this time - a single slash is used to encode an empty paragraph, something that markdown doesn’t natively support.
For display you can strip these with a regex
On Thu, Sep 30, 2021 at 13:51 Guido Zuidhof @.***> wrote:
I am seeing the same behavior, I haven't been able to figure out the cause.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/outline/rich-markdown-editor/issues/532#issuecomment-931537247, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC474UPAQGTN4BSIWIENH3UESPTBANCNFSM5CWOSIWQ .
Yeah, stripping with regexp is that's what I've done eventually, so now my onChange
looks like
onChange: (v: () => string) => {
const val = v();
const stripRegEx = new RegExp(/^\\\W*$/gm)
const savedValue = stripRegEx.test(val) ? val.replace(/^\\/, "") : val
setValue(savedValue);
save(savedValue);
},
Yeah, stripping with regexp is that's what I've done eventually, so now my
onChange
looks likeonChange: (v: () => string) => { const val = v(); const stripRegEx = new RegExp(/^\\\W*$/gm) const savedValue = stripRegEx.test(val) ? val.replace(/^\\/, "") : val setValue(savedValue); save(savedValue); },
I do the same as you but get this error. Can anyone help me get rid of that nasty backlash from the end of my string. Thanks
A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
\
\
is set as a valueExpected behavior Empty string is expected
Version 11.12.0-0
Screenshots
Desktop (please complete the following information):