Skip to content

fix(site): Handle indenting better - #595

Open
mvadari wants to merge 3 commits into
XRPLF:masterfrom
mvadari:fix-indenting
Open

fix(site): Handle indenting better#595
mvadari wants to merge 3 commits into
XRPLF:masterfrom
mvadari:fix-indenting

Conversation

@mvadari

@mvadari mvadari commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

High Level Overview of Change

Context of Change

Type of Change

  • New XLS Draft
  • XLS Update (changes to an existing XLS)
  • XLS Status Change (e.g., Draft → Final, Draft → Stagnant)
  • Process/Meta (changes to CONTRIBUTING.md, XLS-1, templates, etc.)
  • Infrastructure (CI, workflows, scripts, website)
  • Documentation (README updates, typo fixes)

@mDuo13

mDuo13 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Seems fine

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new indentation normalizer can outdent nested ordered-list content (e.g., multi-digit markers like 13.), which can break CommonMark/GitHub list nesting and alter rendered document structure.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the static-site generator’s Markdown preprocessing to better normalize nested list indentation for Python-Markdown rendering, and adjusts list indentation in the confidential MPT XLS to match the intended nesting.

Changes:

  • Add normalize_list_indentation() in scripts/build_site.py and apply it before Markdown-to-HTML conversion.
  • Fix nested list indentation in XLS-0096-confidential-mpt/README.md under the “Compact Send sigma proof” section.
File summaries
File Description
XLS-0096-confidential-mpt/README.md Adjusts nested bullet indentation so the list renders with the intended hierarchy.
scripts/build_site.py Introduces list-indentation normalization to reduce rendering differences between GitHub/CommonMark and Python-Markdown.
Review details

Suppressed comments (1)

scripts/build_site.py:115

  • Continuation lines are also potentially outdented when the parent list item’s content column is > 4*(depth+1) (e.g., multi-digit ordered list markers with extra spacing). Outdenting can move content left of the required CommonMark content column and change list structure in GitHub-rendered Markdown.
        shift = 4 * (stack[-1][2] + 1) - stack[-1][1] if stack else 0
        out.append(_shift(line, shift))
  • Files reviewed: 1/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/build_site.py Outdated
stack.pop()
depth = len(stack)
stack.append((indent, item_match.end(), depth))
out.append(_shift(line, 4 * depth - indent))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added a defensive clamp in a36cc55 so both the marker shift and the continuation shift never move a line below its parent's content column. Wide ordered markers (e.g. 100. ) now keep their nested children at the original indent instead of being outdented.

Never outdent a list marker or its continuations below the parent's
content column. This preserves CommonMark nesting for the edge case
where an ordered marker (`100.`, etc.) is wider than one tab stop.
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.

3 participants