Skip to content

wrap_comments breaks links with long URL #4023

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

Closed
Juici opened this issue Jan 19, 2020 · 0 comments · Fixed by #4042
Closed

wrap_comments breaks links with long URL #4023

Juici opened this issue Jan 19, 2020 · 0 comments · Fixed by #4042

Comments

@Juici
Copy link

Juici commented Jan 19, 2020

#3787 is still an issue.

When running rustfmt with wrap_comments = true, markdown links get chopped in half thus breaking them.

Version information:

rustfmt 1.4.11-nightly (1838235 2019-12-03)
rustc 1.42.0-nightly (859764425 2020-01-07)
cargo 1.42.0-nightly (6e1ca924a 2020-01-06)
rustup 1.21.1 (7832b2ebe 2019-12-20)
Contents of rustfmt.toml
		max_width = 100
		hard_tabs = false
		tab_spaces = 4
		wrap_comments = true
		comment_width = 80
		normalize_comments = true
		merge_imports = false
		reorder_imports = true
		reorder_modules = true
		reorder_impl_items = true
		trailing_semicolon = true
		trailing_comma = "Vertical"
		match_block_trailing_comma = false
		blank_lines_upper_bound = 1
		blank_lines_lower_bound = 0
		merge_derives = true
		use_try_shorthand = true
		unstable_features = true
		edition = "2018"
	

Contents of rustfmt.toml relating to comments:

max_width = 100
wrap_comments = true
comment_width = 80
normalize_comments = true
unstable_features = true

edition = "2018"

Output with --check flag:

     /// Bots as well as users with the permission [`MANAGE_MESSAGES`] or
     /// [`MANAGE_CHANNEL`], are unaffected.
     ///
-    /// [`MANAGE_MESSAGES`]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
-    /// [`MANAGE_CHANNEL`]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNEL
+    /// [`MANAGE_MESSAGES`]:
+    /// ../permissions/struct.Permissions.html#associatedconstant.
+    /// MANAGE_MESSAGES [`MANAGE_CHANNEL`]:
+    /// ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNEL
     #[serde(default, rename = "rate_limit_per_user")]
     pub rate_limit: u16,
     /// The ID of the parent category of the channel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant