fsprojects / FSharp.Formatting

F# tools for generating documentation (Markdown processor and F# code formatter)
https://fsprojects.github.io/FSharp.Formatting/
Other
462 stars 155 forks source link

Some displayed examples may have broken indendation #850

Closed aski-codes closed 8 months ago

aski-codes commented 8 months ago

Hi, the example here (List.concat) is seemingly not working, however this is due to messed up indentation. The source looks correct, so it's likely an issue with the rendering.

billede

https://fsharp.github.io/fsharp-core-docs/reference/fsharp-collections-listmodule.html#concat

nojaf commented 8 months ago

Hi there,

Are you sure?

image

I was able to copy the code and paste it just fine in F# interactive.

nhirschey commented 8 months ago

@aski-codes what browser are you using?

It renders with proper spacing on Edge and mobile safari.

nojaf commented 8 months ago

Worked for me in Chrome.

aski-codes commented 8 months ago

Hmm, it looks cleaner in your browser, somehow. I'm on Firefox 117.01

nojaf commented 8 months ago

It does show slightly off in Firefox for me as well: image

Although copy-pasting it from there still worked for me.

aski-codes commented 8 months ago

If I do a straight copy, I get:

"(4,2): error FS0010: Unexpected identifier in binding. Expected incomplete structured construct at or before this point or other token."

It looks exactly like the web page, but I noticed a blank starting line 4. If I remove it, so that "input" in line 4 aligns with "let" in line 1, I instead get:

"(1,15): error FS3217: This expression is not a function and cannot be applied. Did you intend to access the indexer via 'expr[index]'?"

billede

nhirschey commented 8 months ago

When I do straight copy+paste from firefox it works correctly. I am on windows 11 and it works. What platform are you on @aski-codes?

I tried pasting directly into dotnet fsi from terminal and vs code, both were correctly aligned.

aski-codes commented 8 months ago

I'm on Mac 12.4

nhirschey commented 8 months ago

Note: Google search shows various rendering problems for google fonts (we use roboto mono) on firefox, and particularly macOS.

Seems to be related to fontweight. When I uncheck "font-weight: 600" in the css in the firefox inspector, the spacing is correct.

fonts

aski-codes commented 8 months ago

Thanks, how do you get to that place in inspector, I can't seem to match it...

billede

Seems to be related to fontweight. When I uncheck "font-weight: 600" in the css in the firefox inspector, the spacing is correct.

aski-codes commented 8 months ago

looks fine now, thanks so much!