-
Notifications
You must be signed in to change notification settings - Fork 905
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
wrap_comments breaks markdown formatting #627
Comments
I also encountered similar problems for code blocks within comments - I haven't reported a separate bug - should I? |
There is already an issue for broken code blocks in comments. We have a lot of problems with comments right now :-( |
Another test case: //! This example shows how to configure fern to output really nicely colored logs
//! - when the log level is error, the whole line is red
//! - when the log level is warn, the whole line is yellow
//! - when the log level is info, the level name is green and the rest of the line is white
//! - when the log level is debug, the whole line is white
//! - when the log level is trace, the whole line is gray ("bright black")
is reformatted as //! This example shows how to configure fern to output really nicely colored
//! logs - when the log level is error, the whole line is red
//! - when the log level is warn, the whole line is yellow
//! - when the log level is info, the level name is green and the rest of the
//! line is white - when the log level is debug, the whole line is white
//! - when the log level is trace, the whole line is gray ("bright black")
completely breaking the list (it no longer even resembles a list). (diff output)-//! This example shows how to configure fern to output really nicely colored logs⏎
-//! - when the log level is error, the whole line is red⏎
+//! This example shows how to configure fern to output really nicely colored⏎
+//! logs - when the log level is error, the whole line is red⏎
//! - when the log level is warn, the whole line is yellow⏎
-//! - when the log level is info, the level name is green and the rest of the line is white⏎
-//! - when the log level is debug, the whole line is white⏎
+//! - when the log level is info, the level name is green and the rest of the⏎
+//! line is white - when the log level is debug, the whole line is white⏎
//! - when the log level is trace, the whole line is gray ("bright black")⏎ |
With ///
-/// All the parameters ***except for `from_theater`*** should be inserted as sent by the remote
-/// theater, ie. as passed to [`Theater::send`] on the remote actor:
-/// * `from` is the sending (remote) [`ActorId`], as reported by the remote theater by theater-specific means
-/// * `to` is the receiving (local) [`ActorId`], as requested by the remote theater
-/// * `tag` is a tag that identifies the message type
-/// * `msg` is the (serialized) message
+/// All the parameters ***except for `from_theater`*** should be inserted as
+/// sent by the remote theater, ie. as passed to [`Theater::send`] on the
+/// remote actor: * `from` is the sending (remote) [`ActorId`], as reported by
+/// the remote theater by theater-specific means * `to` is the receiving
+/// (local) [`ActorId`], as
+/// requested by the remote theater * `tag` is a tag that identifies the
+/// message type * `msg` is the (serialized) message
/// |
Rustfmt currently cannot handle markdown in comments, cf. [1]. As a consequence, the itemized list in inject would be broken by it. [1] rust-lang/rustfmt#627
Maybe what could be done is to recognise lines with a leading itemization marker ( Below is an example of what that could look like: -/// All the parameters ***except for `from_theater`*** should be inserted as sent by the remote
-/// theater, ie. as passed to [`Theater::send`] on the remote actor:
-/// * `from` is the sending (remote) [`ActorId`], as reported by the remote theater by theater-specific means
-/// * `to` is the receiving (local) [`ActorId`], as requested by the remote theater
+/// All the parameters ***except for `from_theater`*** should be inserted as
+/// sent by the remote theater, ie. as passed to [`Theater::send`] on the remote
+/// actor:
+/// * `from` is the sending (remote) [`ActorId`], as reported by the remote
+/// theater by theater-specific means
+/// * `to` is the receiving (local) [`ActorId`], as requested by the remote
+/// theater
/// * `tag` is a tag that identifies the message type
/// * `msg` is the (serialized) message |
Given the following:
rustfmt, with
wrap_comments
set totrue
, is reformatted as:Notice that the inner bullet point is no longer part of either list.
The text was updated successfully, but these errors were encountered: