Commit e8994da
schema: any markdown heading terminates a FAQ answer, not just "## " (#20841)
* schema: any markdown heading terminates a FAQ answer, not just "## "
faq-entity.html previously ended a running FAQ answer only when it hit a
line starting with "## ". A non-question "###"/"####" sub-heading, or a
code fence / table / list nested under a question's answer, was NOT a
boundary, so its text (including the literal "###"/"####" markdown prefix)
got appended verbatim into acceptedAnswer.text. On pages with deep
narrative structure under a question-shaped heading, this produced
polluted FAQPage answers up to several thousand characters long.
Now any line whose trimmed form starts with "#" ends the current answer,
matching how a human reader would parse the section boundary. Verified
with an isolated Hugo harness: a synthetic page with a clean question, a
non-question H3 sub-heading, an H4 under that, and a final question,
correctly stops each answer at the first heading of any level and no
heading markdown leaks into acceptedAnswer.text. Also re-rendered the 5
real /what-is/ pages touched in the companion content PR
(seo/what-is-faq-sweep-content): all 36 FAQ questions across those pages
now have clean, bounded answers under 700 characters with zero
markdown artifacts, down from several answers exceeding 4,000 characters
pre-fix.
* Guard FAQ heading terminator against code-fenced comment lines
A heading-shaped comment line inside a fenced code sample (e.g. '# Install
the CLI') was falsely terminating an FAQ answer early, truncating the
emitted FAQPage structured data. Track fenced code blocks and require real
heading syntax (1-6 '#' + space) rather than a bare leading '#'.
---------
Co-authored-by: workprentice <257153108+workprentice@users.noreply.github.com>1 parent cc3f6e6 commit e8994da
1 file changed
Lines changed: 27 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
38 | 53 | | |
39 | | - | |
40 | 54 | | |
41 | 55 | | |
42 | 56 | | |
| |||
64 | 78 | | |
65 | 79 | | |
66 | 80 | | |
67 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
68 | 89 | | |
69 | 90 | | |
70 | 91 | | |
| |||
0 commit comments