mirror of https://github.com/garrytan/gstack.git
URL_RE (/\bhttps?:\/\/\S+/g) is carved after TAG_RE, but the placeholder TAG_RE leaves behind (\u0000SMARTPANTS_PRESERVED_N\u0000) contains no whitespace. A URL sitting flush against a tag therefore matches the URL plus the following placeholder: <p>see <a href="https://ex.com">https://ex.com</a> ok</p> carves to `...PH_1https://ex.comPH_2 ok...`, and \S+ grabs `https://ex.comPH_2`. Restore is a single pass, so the nested PH_2 never restores: the literal text SMARTPANTS_PRESERVED_2 renders in the PDF and the `</a>` is gone, leaving an unclosed anchor that bleeds link-blue through every following paragraph until some later `</a>` closes it. A bold URL swallows `</a></strong>` and leaks bold too. Exclude the sentinel from URL_RE so carved placeholders survive. The existing "does NOT touch URLs" test missed this because its URL is followed by a space, not a tag. Fixes #2084 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| browseClient.ts | ||
| cli.ts | ||
| commands.ts | ||
| diagram-prepass.ts | ||
| image-policy.ts | ||
| image-size.ts | ||
| orchestrator.ts | ||
| pdftotext.ts | ||
| print-css.ts | ||
| render.ts | ||
| setup.ts | ||
| smartypants.ts | ||
| types.ts | ||