Page 1 of 1

Extra Space Added in Empty Lines in Markdown Component

Posted: Tue Jan 07, 2025 6:31 pm
by a.mancini
Hello,

We have encountered an issue with the Markdown component used in our project.
Whenever an empty line is present in the Markdown content, saving and reloading the document introduces an extra space in the empty line.

This behavior becomes problematic when editing a document multiple times, as it requires manually removing the unwanted spaces to maintain proper alignment between lines. If unnoticed, these additional spaces can lead to inconsistencies in the document layout and formatting.

Best regards
Alessandro Mancini

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Tue Jan 07, 2025 9:01 pm
by Sergey Tkachenko
Unfortunately, Markdown does not allow empty paragraphs. So TRichView adds a non-breaking space ( ) to them when saving.
It would be possible to save <br> instead. <br> is one of few HTML tags that TRichView parses inside Markdown. However, this is not a paragraph break but a line break inside a paragraph.
I can add an option in loading to remove NBSP in paragraphs loaded from Markdown, if this is the only character in the paragraph.

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Wed Jan 08, 2025 2:18 pm
by a.mancini
Thank you for your explanation regarding the handling of empty paragraphs in Markdown. I understand the current behavior and appreciate the clarification.

I believe the proposed option to remove non-breaking spaces (NBSP) in paragraphs loaded from Markdown, if they are the only character in the paragraph, would be a great solution. I kindly ask you to implement this feature, as it would significantly improve the usability of the component in our use case.

I look forward to the next version including this option and want to thank you for considering this enhancement.

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Mon Apr 28, 2025 8:09 am
by a.mancini
Hello,

Is this feature included in the new release?

Best regards

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Tue Apr 29, 2025 12:48 pm
by Sergey Tkachenko
Sorry, it was not included in the last release.
But I've made these changes. If you want, I can send modified units to you by email.
They will be included in the next update.

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Mon May 05, 2025 8:51 am
by a.mancini
No worries, I can wait for the next update. Thanks for your support!

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Mon Feb 23, 2026 5:50 pm
by a.mancini
Hello,

Do you have any updates ?
best regards
Alessandro Mancini

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Sun Mar 01, 2026 3:20 pm
by Sergey Tkachenko
Yes, it is included in TRichView 24.x.

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Fri Mar 27, 2026 10:17 pm
by a.mancini
ok thanks

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Thu Apr 02, 2026 5:46 pm
by a.mancini
Hello,

I’m looking for the new property option but I can’t find it. I also checked the release notes, but there’s no mention of it. Am I missing something?

Best regard
Alessandro Mancini

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Fri Apr 03, 2026 3:12 pm
by Sergey Tkachenko
The new option (removing non-breaking spaces from empty lines read from HTML, Markdown, RTF, and DocX) works by default.
It can be turned off by assigning False to RichViewRemoveNbSpAfterImport (global variable from CRVData.pas)

Re: Extra Space Added in Empty Lines in Markdown Component

Posted: Sat Apr 04, 2026 8:28 am
by a.mancini
OK thanks