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!