You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem with this case is that it rustfmt damages valid code, so I believe some solution is needed (for example, just skip formatting of comments if they have #[doc]).
The linked issue is closed because of technical limitations on rustfmt's side. Maybe it's possible to skip formatting altogether if there's a mix of sugared and de-sugard doc comments. I'll reopen this one for now as a feature request, but I'll be honest this is pretty low priority, and I don't anticipate the rustfmt team working on this directly.
ytmimi
changed the title
format_code_in_doc_comments HTML tags break when #[doc] is used
[Feature Request] Skip formatting doc comments altogether when mixing sugared and de-sugared doc comments
Jan 10, 2024
Input:
Outputs:
Note no empty line before second example. So rustdoc of output looks like this:
Empty lines before backticks are important for Markdown.
Rustdoc uses commonmark
HTML blocks in commonmark must end with empty line:
The text was updated successfully, but these errors were encountered: