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

Double line breaks are stripped out #40

Closed
danielallsopp opened this issue Nov 14, 2023 · 4 comments
Closed

Double line breaks are stripped out #40

danielallsopp opened this issue Nov 14, 2023 · 4 comments
Labels
2023Q4 bug Something isn't working

Comments

@danielallsopp
Copy link

danielallsopp commented Nov 14, 2023

In the following HTML example:
One<br /><b>Two</b><br /><i>Three</i><br /><i><b>Four</b></i><br /><br />New <b>Paragraph</b>!

should render with a line break after the 'Four' and before the 'New Paragraph' is rendered. However, I've noticed when the HTML string is parsed, the second line break is stripped out, so the render ends up like this:

incorrect

instead of this:

correct

Can this functionality be switched off, or is there a bug present?

EDIT: I've found this function in the source code which seems to the be the culprit:

func reduceBreaklineInResultNSAttributedString(_ attributedString: NSAttributedString) -> NSAttributedString

but I can't find anyway of switching it off, or overriding the functionality.

@zhgchgli0718 zhgchgli0718 added bug Something isn't working 2023Q4 labels Nov 24, 2023
@charrondev
Copy link
Contributor

@danielallsopp You can see in my recent PR here I added a policy to modify line break behaviour. #37

For me I found the behaviour was adding more line breaks that I preferred. Maybe there could be another line break policy added that makes no changes to the built-in line breaks. (call it raw or something like that?).

@zhgchgli0718
Copy link
Member

v1.7.0 fixed and release, thanks to @charrondev

@www-r3m1x
Copy link

@zhgchgli0718 This bug not fixed in 1.7.0

@zhgchgli0718 zhgchgli0718 reopened this Dec 13, 2023
@zhgchgli0718
Copy link
Member

image
In the latest version 1.8.0, the issues have been addressed.
Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2023Q4 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants