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

Fix: support configuring the indent_width for markdown files #132

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MohammadSu1
Copy link

Closes denoland/deno#26863
This PR supports configuring the indent width for markdown files.

@CLAassistant
Copy link

CLAassistant commented Dec 8, 2024

CLA assistant check
All committers have signed the CLA.

@bartlomieju bartlomieju requested a review from dsherret December 10, 2024 12:35
@@ -8,6 +8,7 @@ use serde::Serialize;
#[serde(rename_all = "camelCase")]
pub struct Configuration {
pub line_width: u32,
pub indent_width: u32,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test that exercises this option?

@@ -49,6 +49,10 @@ impl ConfigurationBuilder {
self.insert("lineWidth", (value as i32).into())
}

pub fn indent_width(&mut self, value: u32) -> &mut Self {
self.insert("indentWidth", (value as i32).into())
}
Copy link
Member

@dsherret dsherret Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this out? I don't think it will work. I never added indent width to markdown because markdown is very specific about how indentation works. For example, code blocks are 4 spaces and some indent is 3 spaces.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a test to verify if it works correctly. Thank you for bringing this to my attention.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dsherret You’re right. I tried testing it after the modification, but it failed. Do you have any suggestions that could help resolve this issue?

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 this pull request may close these issues.

Markdown --indent-width is ignored
4 participants