-
Notifications
You must be signed in to change notification settings - Fork 1
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
Multiple inline elements without extra whitespace #4
Comments
Hmm... We could add a low-level variable to Element that specifies whether it should be followedf by a newline or not, which might allow us to collapse them when rendering But, web-view strongly encourages flexbox (built in to row and col), which overrides any whitespace, and I believe dodges any rendering issues related to this. The top answer on your workaround link mentions this. Can we get some sample code demonstrating a real-world issue?
|
The most trivial example is a sentence with a link, which is followed by punctation mark. My use case is "syntax" "highlighting" of shell command to dim shell escaping overhead. Flex does can visually help, but leaves copy-paste busted (copies excess newlines). I don't think using that would scale for any serious typesetting either. Demo: https://codepen.io/kfigiela/pen/mdYqyea |
@kfigiela Latest commit should fix this! |
Thanks. We may still need to expose this a little bit more (add |
You shouldn't need another helper: |
But yeah, good idea to update |
Web-view renderer adds newlines and indentation for pretty formatted human-readable output. This is not a problem for block/flex elements, but is definitely an issue when it comes to inline elements and this is well known issue related to pretty printing.
Let's consider this trivial example, for real-world use-case consider code highlightning.
One would expect this to render
foo<span>/</span>bar
, however, this is rendered with extra whitespace asfoo\n\n<span>/</span>\n\nbar\n
and the user will seefoo / bar
instead offoo/bar
. There are workarounds available and we can just useraw
, but none of this is pretty.Any ideas how to tackle this?
The text was updated successfully, but these errors were encountered: