Commit f7290a1
committed
fix(docs-gen): escape bare < in generated API markdown
docfx emits two C#-generic patterns whose opening `<` is bare while
the closing `>` is markdown-escaped as `\>`:
1. heading text after the anchor close, e.g.
`### <a id="…"></a> CollectShell(string, List<EnvVarInfo\>)`
2. return / parameter blocks where docfx renders an outer-generic
link followed by an inner-generic link, e.g.
` [List](…)<[EnvVarInfo](…)\>`
VitePress's underlying Vue template compiler sees the bare `<` as the
start tag of an element that never closes (the escaped `\>` is rendered
as a literal `>` rather than an end-tag token), tripping "Element is
missing end tag" during `vitepress build` and failing the Docs-site
CI's Build VitePress site job.
Add a post-processing awk pass to generate-api-ref.sh that rewrites
`<[A-Z]` and `<[` outside fenced code blocks to `<[A-Z]` /
`<[`. The `<` HTML entity survives the markdown -> HTML
pipeline, whereas a backslash-escape would decode back to `<` and
re-trip the same error. The awk filter tracks ```-fence state so
signatures in code blocks (e.g. `public IReadOnlyList<EnvVarInfo>
Collect(...)`) stay untouched, and the lowercase `<a id="…"></a>`
anchor itself is unaffected because the pattern requires either an
uppercase letter or `[`.1 parent f3e44cc commit f7290a1
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
152 | 196 | | |
0 commit comments