Skip to content

Conversation

@dmadisetti
Copy link
Collaborator

@dmadisetti dmadisetti commented Oct 28, 2025

Fixes #6458

📝 Summary

Adds lint rule and codegen change that enforces markdown dedent.

Following front end convention, the following markdown is expected:

mo.md(
    """
A multiline statement.
"""
)
mo.md("A single liner (can also be triple)")
mo.md(
    "A very very very very very very very very very very very very very long single liner (can also be triple)"
)

note: This is a noisy PR since examples are formatted. Look at commits standalone:

test: Add in tests for md check
feat: Add markdown tidy rule and auto formatting
tidy: refresh examples
docs: update documentation rules

@dmadisetti dmadisetti requested a review from akshayka as a code owner October 28, 2025 17:51
@vercel
Copy link

vercel bot commented Oct 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Oct 29, 2025 4:42pm

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 28, 2025
@dmadisetti dmadisetti changed the title feat: force markdown formatting on save feat: enforce markdown formatting on save Oct 28, 2025
@@ -0,0 +1,48 @@
# MF007: markdown-dedent
Copy link
Contributor

Choose a reason for hiding this comment

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

i wonder if the rule should be markdown-indentation since it captures more than dedent. but if this is internal, we can change the name whenever

mscolnick
mscolnick previously approved these changes Oct 28, 2025
Copy link
Contributor

@mscolnick mscolnick left a comment

Choose a reason for hiding this comment

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

nice, great stuff!

mscolnick
mscolnick previously approved these changes Oct 29, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

return {
code: `${start}${escapedCode}"""\n)`,
offset: start.length,
};
Copy link

Choose a reason for hiding this comment

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

Bug: Markdown Parsing Error Causes Invalid Python Syntax

The markdown parser generates an extra double-quote character when breaking long single-line markdown cells. This creates invalid Python syntax by mixing string literal types, such as mo.md(" with r""".

Fix in Cursor Fix in Web


if not notebook_cell:
return

Copy link

Choose a reason for hiding this comment

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

Bug: Linting Halts on Unmatched Cells

The check function exits prematurely when a notebook cell cannot be matched, preventing the linting rule from processing subsequent cells. This leads to incomplete linting for the entire notebook.

Fix in Cursor Fix in Web

@mscolnick mscolnick merged commit 65e4429 into main Oct 29, 2025
30 of 42 checks passed
@mscolnick mscolnick deleted the dm/md-check branch October 29, 2025 17:01
mscolnick added a commit that referenced this pull request Oct 30, 2025
Reverts a change makes in #6969 which breaks a lot of markdown. 

Fixes #6997
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Help with adding a py:marimo format in Jupytext

3 participants