-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
spacingPolicy missing from Builder API even though mentioned in README #50
Comments
I'm sorry, the spacingPolicy parameter has been removed and will now refer directly to the browser's line-breaking rules for implementation. ref #47 |
Thanks for the quick reply
What do you mean it will refer to the "browser's" line-breaking rules? I didn't think this library used a web browser to generate the |
|
The initial version of the ZMarkupParser's line-breaking strategy involved directly converting However, upon comparing the results with those rendered by web browsers, we noticed that browsers tend to merge consecutive For example, in the case of To replicate this behavior, I implemented a similar line-breaking merge strategy. As a result, the option |
Got it thank you. I believe CSS as a line break collapsing strategy for
paragraphs as well.
Cameron.
…On Wed, 27 Mar 2024 at 14:54, ZhgChgLi ***@***.***> wrote:
Thanks for the quick reply
refer directly to the browser's line-breaking rules for implementation
What do you mean it will refer to the "browser's" line-breaking rules? I
didn't think this library used a web browser to generate the
AttributedString?
The initial version of the ZMarkupParser's line-breaking strategy involved
directly converting <div>, <p>, or <br/>... tags into line breaks \n.
However, upon comparing the results with those rendered by web browsers,
we noticed that browsers tend to merge consecutive <br/> tags:
For example, in the case of <p>This is a paragraph.<br/></p>, the actual
line break would be This is a paragraph.\n, rather than This is a
paragraph.\n\n.
To replicate this behavior, I implemented a similar line-breaking merge
strategy.
As a result, the option paragraphSpacing to externally configure
line-breaking rules was removed, and everything now follows the behavior of
web browsers.
—
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEZ6SJHPFBYXJDRSXEGJCLY2LMQZAVCNFSM6AAAAABEQHDSSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRSHE3TMNZSGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
about SwiftUI problems, Please feel free to refer to this comment. thank you. |
I'm trying to control how paragraph spacing works and according to the README I should be able to use a
spacingPolicy
builder method but it doesn't exist.Looks like this option was removed in this commit 8eba375#diff-02bc2fdf518816d7a3c9ea9bb354a3c7bf3e7356b3f87a48e16283c8480a0c8e
There is no indication of how to control paragraph behaviour and the documentation gives out-of-date instructions.
The text was updated successfully, but these errors were encountered: