astrale-sharp / typstfmt

Apache License 2.0
253 stars 25 forks source link

[bug] A whitespace is added between text and inline code #84

Closed Andrew15-5 closed 1 year ago

Andrew15-5 commented 1 year ago

This:

a#sym.RR

a#f()

Will be formatted like this:

a #sym.RR

a #f()

Which also will/can change the output and therefore is a bug. See https://github.com/astrale-sharp/typstfmt/issues/82#issuecomment-1701517244 or just #82.

Default config

Version commit: https://github.com/astrale-sharp/typstfmt/commit/9da3fa3fe2208532877ee4d6a906373d6b37fade

astrale-sharp commented 1 year ago

This should be fixed but the fix seems brittle to me, we're now always respecting the space before a Hashtag, but lorem ipsum #loooooooooooooooong_var should probs be broken before long_var which is more subtle than the current fix

An idea would be to add the possibility for non text like node to break according to text length as well

astrale-sharp commented 1 year ago

That's a separate issue tho so I'll close this one