Skip to content

Fix spacing issues when converting <strong>, <u>, <del>, <em> tags to markdown #657

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mumberrymountain
Copy link

@mumberrymountain mumberrymountain commented Jun 1, 2025

fix issue #656

String html1 = "<p><strong>My strong text. </strong>test</p>";
String converted1= converter.convert(html1);
System.out.println(converted1); // **My strong text.**test

String html2 = "<p><strong>My strong text. </strong><span>test</span></p>";
String converted2= converter.convert(html2);
System.out.println(converted2); // **My strong text.** test
  1. space wrapping for <strong>, <up>, <del>, <em> tags is applied only when next sibling is an element.

  2. add a space before if the inner text starts with some special char (in 'prepend**.some**', bold is ignored because of the dot)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant