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

Markdownlint new rule: Custom replacement for MD048 - fenced codeblocks rule with fixer #27915

Conversation

MaoShizhong
Copy link
Contributor

@MaoShizhong MaoShizhong commented May 2, 2024

Because

Markdownlint's built-in MD048 rule for fenced code block style does not include fix information, so will require manual fixing. It would be more straightforward for us to disable the built-in and use a custom rule to enforce the same style and provide a custom fixer for our fix scripts.

This PR

  • Adds a custom version of the MD048 built-in, with fix info
  • Adds appropriate test and doc files
  • Appends custom rule to markdownlint config custom rules array
  • Disables the built-in MD048 rule

Issue

N/A

Additional Information

Discovered through this, TOP006 will need amending to account for ~ code blocks as well. Currently it only recognises ` code blocks, so something like ~~~md will be fixed to ```md instead of ```markdown. This will be handled in a separate PR. Fixed in #27916

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

Small refactor for readability.
Fixed abbreviated code block language in test file.
@MaoShizhong MaoShizhong changed the title Markdownlint new rule: Custom fenced codeblocks rule with fixer Markdownlint new rule: Custom replacement for MD048 - fenced codeblocks rule with fixer May 7, 2024
@MaoShizhong MaoShizhong merged commit 64151ff into TheOdinProject:main May 15, 2024
2 of 3 checks passed
@MaoShizhong MaoShizhong deleted the markdownlint/custom-fenced-codeblocks-rule-with-fixer branch May 15, 2024 11:39
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.

None yet

2 participants