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

  not being correctly formatted in documentation #15463

Open
1 task done
failable opened this issue Jul 30, 2024 · 6 comments
Open
1 task done

  not being correctly formatted in documentation #15463

failable opened this issue Jul 30, 2024 · 6 comments
Labels
bug [core label] markdown Markdown markup support popovers Feedback for tooltips, syntax hints, info popups, toasts, etc priority request A request from a stakeholder or influential user python Python programming language support

Comments

@failable
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

image

Environment

Zed: v0.146.1 (Zed Preview)
OS: macOS 14.5.0
Memory: 32 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
@failable failable added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Jul 30, 2024
@notpeter notpeter added markdown Markdown markup support popovers Feedback for tooltips, syntax hints, info popups, toasts, etc python Python programming language support and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 30, 2024
@notpeter
Copy link
Member

notpeter commented Jul 30, 2024

Looks like the markdown *serializer* *default* and __structlog__ are not being rendered as italic/underline either, but with other language servers (e.g. LuaLS) that seems to work so this may be a Python (Pyright) specific issue:
Screenshot 2024-07-30 at 10 54 52

Neither correctly render   to so that's definitely a bug.

@dovakin0007
Copy link
Contributor

pulldown-cmark/pulldown-cmark#713 is it something related to this?

@jean-humann
Copy link

@notpeter Seems to be the way Pyright handle whitespace and tabulation in doctoring: https://github.com/microsoft/pyright/blob/386b7fe0a53632e9666ba44d2c0a8ae1e7a9aa4d/packages/pyright-internal/src/analyzer/docStringConversion.ts#L297

@failable
Copy link
Author

image

</br> also not rendered.

@github-actions github-actions bot added admin read Pending admin review triage Maintainer needs to classify the issue labels Nov 5, 2024
@notpeter notpeter removed triage Maintainer needs to classify the issue admin read Pending admin review labels Nov 5, 2024
@notpeter
Copy link
Member

From @tkz789 comment in #16980 (merged into this issue)

It seems to be a general error with all python docstrings I saw. Whenever there are spaces at the beginning of the line resulting in indentation, it is parsed to &nbsp.

@notpeter
Copy link
Member

notpeter commented Nov 12, 2024

Pyright appears to be converting all leading spaces from docstrings into a series of &nbsp; in an attempt to preserve hanging indentation which would otherwise get collapsed to a single space. link
Screenshot 2024-11-12 at 10 18 32

pulldown_cmark (which Zed uses for Markdown rendering) has decided this is correct behavior to preserve raw HTML escapes inside other HTML blocks. So Zed likely needs to reconvert these &nbsp; into again. E.g. s/&nbsp;/ /g

@notpeter notpeter added the priority request A request from a stakeholder or influential user label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] markdown Markdown markup support popovers Feedback for tooltips, syntax hints, info popups, toasts, etc priority request A request from a stakeholder or influential user python Python programming language support
Projects
Status: No status
Development

No branches or pull requests

4 participants