Repository navigation
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Deploying dev-site with
|
| Latest commit: |
7ff8360
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://cb6b1253.dev-site-4ua.pages.dev |
| Branch Preview URL: | https://sromani-uhu-3499-the-markdow.dev-site-4ua.pages.dev |
cb38227 to
a228f18
Compare
| {{- if findRE `(?m)^ *\t` .inner 1 -}} | ||
| {{- errorf "%s: field %q: tabs are not allowed in schema-row indents" .page.File.Path .key -}} | ||
| {{- end -}} | ||
| {{- $head := replaceRE `(?s)\n.*` "" .inner -}} | ||
| {{- $body := strings.TrimPrefix $head .inner -}} | ||
| {{- $indent := -1 -}} | ||
| {{- range findRE `(?m)^ *\S` $body -}} | ||
| {{- $n := sub (len .) (len (strings.TrimLeft " " .)) -}} | ||
| {{- if or (lt $indent 0) (lt $n $indent) }}{{ $indent = $n }}{{ end -}} | ||
| {{- end -}} |
There was a problem hiding this comment.
this can also catch tabs in code blocks.
claude suggests this fix.
| {{- if findRE `(?m)^ *\t` .inner 1 -}} | |
| {{- errorf "%s: field %q: tabs are not allowed in schema-row indents" .page.File.Path .key -}} | |
| {{- end -}} | |
| {{- $head := replaceRE `(?s)\n.*` "" .inner -}} | |
| {{- $body := strings.TrimPrefix $head .inner -}} | |
| {{- $indent := -1 -}} | |
| {{- range findRE `(?m)^ *\S` $body -}} | |
| {{- $n := sub (len .) (len (strings.TrimLeft " " .)) -}} | |
| {{- if or (lt $indent 0) (lt $n $indent) }}{{ $indent = $n }}{{ end -}} | |
| {{- end -}} | |
| {{- $head := replaceRE `(?s)\n.*` "" .inner -}} | |
| {{- $body := strings.TrimPrefix $head .inner -}} | |
| {{- $indent := -1 -}} | |
| {{- range findRE `(?m)^ *\S` $body -}} | |
| {{- $n := sub (len .) (len (strings.TrimLeft " " .)) -}} | |
| {{- if or (lt $indent 0) (lt $n $indent) }}{{ $indent = $n }}{{ end -}} | |
| {{- end -}} | |
| {{- $tab := cond (lt $indent 0) `(?m)^ *\t` (printf `(?m)^ {0,%d}\t` (sub $indent 1)) -}} | |
| {{- if and (ne $indent 0) (findRE $tab $body 1) -}} | |
| {{- errorf "%s: field %q: tabs are not allowed in schema-row indents" .page.File.Path .key -}} | |
| {{- en |
The Markdown schema-row partial removed exactly two leading spaces from each line of a field description. That is correct only while every row uses a two-space base indent. A row with a different indent lost its list nesting, or became an indented code block, and Hugo gave no error. Find the smallest space indent of the description lines with text and remove that amount. Text on the opening-tag line has no indent, so the partial does not measure or strip that line. All current rows use a two-space or no indent, so the site output does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The schema-row partial counts only spaces when it finds the common indent. A description line indented with a tab keeps its tab, so Hugo renders it as a code block and gives no error. Stop the build when an indent holds a tab. The error names the page and the field, so both schema-row shortcodes pass the page to the partial. No current row uses a tab, so the site output does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tab check ran on the full content, so a tab inside a code block stopped the build. Check for tabs only in the part of the indent that the template strips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a228f18 to
7ff8360
Compare
Fixes UHU-3499: https://linear.app/maxmind/issue/UHU-3499/the-markdown-build-keeps-the-nesting-of-schema-rows-with-any-indent
layouts/partials/markdown/schema-row.mdremoved exactly two leading spaces from each line of a field description. A row with a different indent lost its list nesting, or became a code block, and Hugo showed no error.Verified with a full build: the output is identical to
main. A row indented by four spaces with a nested list keeps its nesting. Lint passes.Follow-up to the review of #1771.
🤖 Generated with Claude Code