Repository navigation
Markdown pages have no runs of blank lines - #1797
Open
shadromani wants to merge 3 commits into
Open
shadromani wants to merge 3 commits into
shadromani wants to merge 3 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Deploying dev-site with
|
| Latest commit: |
8a387de
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7e073482.dev-site-4ua.pages.dev |
| Branch Preview URL: | https://sromani-uhu-3498-markdown-pa.dev-site-4ua.pages.dev |
NajiObeid
requested changes
Oct 27, 2026
Comment on lines
+12
to
+16
| {{- /* One blank line between the body and the list, and no blank lines at | ||
| the end when every child is already linked. */ -}} | ||
| {{- with $unlinked }} | ||
| {{ with $body }} | ||
| {{ end -}} |
Contributor
There was a problem hiding this comment.
Two small things here:
- Section pages with all their children linked now end without a newline. There are 14 pages like that, for example,
minfraud/track-devices/index.md. - If a section has no body, we get two blank lines between the title and "Pages in this section". No occurrences I could find right now in the codebase though.
This should fix both:
Suggested change
| {{- /* One blank line between the body and the list, and no blank lines at | |
| the end when every child is already linked. */ -}} | |
| {{- with $unlinked }} | |
| {{ with $body }} | |
| {{ end -}} | |
| {{- /* End the body with a newline, and add a blank line before the list. | |
| A page with no body needs neither. */ -}} | |
| {{- if $body }} | |
| {{ end -}} | |
| {{- with $unlinked }} | |
| {{- if $body }} | |
| {{ end -}} |
Shortcodes and the newlines around them in the source leave runs of two to five blank lines in the Markdown output. One blank line separates blocks just as well and costs fewer tokens. The body partial now swaps each fenced code block for a placeholder, collapses the runs, and swaps the code back, so blank lines inside samples stay as they are. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A section page whose body already links every child ended with two blank lines, because the blank line before "Pages in this section" was written even when that list was left out. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A section page whose body already links every child ended without a newline, because the newline after the body was written only with the list. The list template now ends the body with a newline on its own and adds the blank line before the list only when there is a body and a list, so a section page ends the way a single page does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
shadromani
force-pushed
the
sromani/uhu-3498-markdown-pages-have-no-runs-of-blank-lines
branch
from
October 27, 2026 20:38
73e08da to
8a387de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes UHU-3498: https://linear.app/maxmind/issue/UHU-3498/markdown-pages-have-no-runs-of-blank-lines
The Markdown output had runs of 2 or more blank lines after shortcodes such as alerts. They do not change the rendered page, but they add tokens.
llms-full.txthad about 385 such runs.layouts/partials/markdown/body.mdcollapses runs of blank lines to one, outside fenced code blocks. Every Markdown page passes through this partial, so one fix covers every shortcode. Blank lines inside code fences do not change.layouts/_default/list.mdno longer writes a blank line before the section page list when that list is empty.Verified with a full build: runs outside code fences went from 400 (46 files) to 0.
llms-full.txtis 576 lines shorter. The HTML output is unchanged. Lint passes.🤖 Generated with Claude Code