Skip to content
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

Text content line break rendering #344

Merged
merged 6 commits into from
Sep 24, 2024
Merged

Conversation

robinst
Copy link
Collaborator

@robinst robinst commented Sep 24, 2024

Fixes #264. Users will be able to configure the line break rendering like this:

var renderer = TextContentRenderer.builder().lineBreakRendering(LineBreakRendering.SEPARATE_BLOCKS).build();

Then input Markdown like this:

foo

bar

Will be rendered like this:

foo

bar

Note that it will separate all blocks (which is slightly different from preserving what the input was), e.g. this:

foo
1. bar

Will be rendered:

foo

1. bar

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 4 lines in your changes missing coverage. Please review.

Project coverage is 95.02%. Comparing base (f82f1e6) to head (6cef998).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...ark/renderer/text/CoreTextContentNodeRenderer.java 95.12% 1 Missing and 1 partial ⚠️
.../commonmark/renderer/text/TextContentRenderer.java 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #344      +/-   ##
============================================
+ Coverage     94.97%   95.02%   +0.04%     
+ Complexity      254      252       -2     
============================================
  Files           136      137       +1     
  Lines          4360     4380      +20     
  Branches        621      620       -1     
============================================
+ Hits           4141     4162      +21     
  Misses          116      116              
+ Partials        103      102       -1     
Files with missing lines Coverage Δ
.../tables/internal/TableTextContentNodeRenderer.java 100.00% <100.00%> (+6.45%) ⬆️
...g/commonmark/renderer/text/LineBreakRendering.java 100.00% <100.00%> (ø)
...rg/commonmark/renderer/text/TextContentWriter.java 86.53% <100.00%> (+8.41%) ⬆️
...ark/renderer/text/CoreTextContentNodeRenderer.java 92.74% <95.12%> (+0.55%) ⬆️
.../commonmark/renderer/text/TextContentRenderer.java 93.02% <75.00%> (-4.48%) ⬇️

@robinst robinst merged commit 4634a00 into main Sep 24, 2024
12 checks passed
@robinst robinst deleted the text-content-line-break-rendering branch September 24, 2024 12:32
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.

Preserving empty line nodes
1 participant