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: 🐛 only remove qmd files in reference post render to fix md formatting issues #1107

Merged

Conversation

signekb
Copy link
Member

@signekb signekb commented Mar 5, 2025

Description

Removing the entire reference/ folder post-render is problematic because the _sidebar.yml file in this folder is referenced under metadata-files in _quarto.yml. When this file is removed post-render, it seems to disrupt Quarto's functionality in VS Code, affecting its visual mode. As a result, formatting (including column wrapping at length 72) doesn't work as expected.

Changing the post-render process to remove only qmd files resolves this issue, since (as far as I understand) preserving _sidebar.yml ensures that _quarto.yml remains valid and maintains an uninterrupted visual mode.

Please check if this works for you locally by:

  1. Go to this branch
  2. Run just build-website (to get the _sidebar.yml back)
  3. In an md or a qmd file, go to visual mode, save it, and go back to source mode.

Is the formatting still OK after these steps for you as well? 🤞

Closes #1089

Removing the entire `reference/` folder post-render is problematic because the `_sidebar.yml` file in this folder is referenced under `metadata-files` in `_quarto.yml`. When this file is removed post-render, it seems to disrupt Quarto's functionality in VS Code, affecting its visual mode. As a result, formatting (including column wrapping at length 72) doesn't work as expected. Changing the post-render process to remove only `qmd` files resolves this issue, since (as far as I understand) preserving `_sidebar.yml` ensures `_quarto.yml` remains valid and maintains an uninterrupted visual mode
@signekb signekb requested a review from a team as a code owner March 5, 2025 15:27
Copy link
Contributor

@martonvago martonvago left a comment

Choose a reason for hiding this comment

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

Wow 🤯 🤯
Well done, it works for me!!! 👏 👏 👏

Copy link
Member

@lwjohnst86 lwjohnst86 left a comment

Choose a reason for hiding this comment

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

Wow, what a weird bug! Tusind tak @signekb

@lwjohnst86 lwjohnst86 merged commit 52092ac into main Mar 5, 2025
2 checks passed
@lwjohnst86 lwjohnst86 deleted the fix/markdown-not-formatting-in-quartos-visual-mode branch March 5, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[bug]: VSCode doesn't reformat Markdown after converting to visual editor
3 participants