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

add indentationStyle to MarkupFormatter.Options #204

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

Conversation

dpowers
Copy link

@dpowers dpowers commented Oct 10, 2024

Summary

Add indentationStyle (.tabs/.spaces) to MarkupFormatter.Options to allow format to use tabs when outputting Markdown.

@QuietMisdreavus
Copy link
Contributor

Could you add a CLI flag to the format tool in Tools/markdown-tool/Commands/FormatCommand.swift? That way this can be set in the command-line formatter and not just the API.

Copy link
Contributor

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

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

Good PR, but a couple more things:

  1. The indentation for content nested underneath a block directive (line 488) uses a four-space indent; i don't think we handle tabs for nested block-directive content, but if that is handled that should also be updated.
  2. Can you add some tests in MarkupFormatterTests?

Comment on lines +454 to +459
prefix += formattingOptions.indentationStyle.indentation()
}
unorderedListCount += 1
} else if element is OrderedList {
if orderedListCount > 0 {
prefix += " "
prefix += formattingOptions.indentationStyle.indentation()
Copy link
Contributor

Choose a reason for hiding this comment

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

These indentation markers use different numbers of spaces between ordered and unordered lists to align trailing text with the previous line. While it may still parse correctly, this is a regression in behavior.

@dpowers
Copy link
Author

dpowers commented Oct 13, 2024 via email

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.

2 participants