Title: id(web/markdown): uppercase/mixed-case and tags are not recognized on import — image degrades to an html code block · Issue #2201 · developing-today/code · GitHub
Open Graph Title: id(web/markdown): uppercase/mixed-case and tags are not recognized on import — image degrades to an html code block · Issue #2201 · developing-today/code
X Title: id(web/markdown): uppercase/mixed-case and tags are not recognized on import — image degrades to an html code block · Issue #2201 · developing-today/code
Description: Bug The HTML tag recognizers in pkgs/id/src/web/markdown.rs match the tag name case-sensitively, while HTML tag names are case-insensitive: parse_img_tag (markdown.rs:1190-1194) requires the literal prefixes "". parse_anc...
Open Graph Description: Bug The HTML tag recognizers in pkgs/id/src/web/markdown.rs match the tag name case-sensitively, while HTML tag names are case-insensitive: parse_img_tag (markdown.rs:1190-1194) requires the litera...
X Description: Bug The HTML tag recognizers in pkgs/id/src/web/markdown.rs match the tag name case-sensitively, while HTML tag names are case-insensitive: parse_img_tag (markdown.rs:1190-1194) requires the litera...
Opengraph URL: https://github.com/developing-today/code/issues/2201
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web/markdown): uppercase/mixed-case \u003cIMG> and \u003cA> tags are not recognized on import — image degrades to an html code block","articleBody":"## Bug\n\nThe HTML tag recognizers in `pkgs/id/src/web/markdown.rs` match the tag name case-sensitively, while HTML tag names are case-insensitive:\n\n- `parse_img_tag` (markdown.rs:1190-1194) requires the literal prefixes `\"\u003cimg \"` or `\"\u003cimg>\"`.\n- `parse_anchor_tag` (markdown.rs:1228-1232) requires `starts_with(\"\u003ca\")`.\n- `parse_linked_img_tag` (markdown.rs:1257-1267) searches for the literal `\"\u003cimg\"` and `\"\u003c/a>\"`.\n\nSo an image written `\u003cIMG SRC=\"x.png\">`, `\u003cImg src=\"x.png\">`, or wrapped as `\u003cA HREF=\"...\">\u003cIMG ...>\u003c/A>` is not recognized on markdown import:\n\n- As an `HtmlBlock` (markdown.rs:500) it falls through to the fallback and becomes an `html` **code block** — the reader sees raw markup instead of the image.\n- As an `HtmlInline` (markdown.rs:530) it becomes a raw `html_inline` atom instead of an `image` node, so it gets no image treatment (no alt/dimension editing, no image save path); the combined `\u003ca>\u003cimg>\u003c/a>` form and the split form merged at markdown.rs:853-854 fail the same way.\n\nThe inconsistency is visible inside the same file: `parse_tag_attrs` (markdown.rs:1152) lowercases every attribute name (`to_ascii_lowercase()`), so `\u003cimg SRC=\"x.png\" ALT=\"A\">` parses fine — only the tag-name gate is case-sensitive. Uppercase/mixed-case tags are what older editors, some HTML generators, and hand-written markup produce; comrak passes raw HTML literals through with their original case.\n\n## Evidence (verified this run, main 318ca58a)\n\nVerbatim copies of `decode_attr_entities`, `parse_tag_attrs`, `parse_img_tag`, `parse_anchor_tag`, `parse_linked_img_tag` compiled and run on the laptop (probe: `~/git/fleet/probe-2026-10-29-laneA-imgcase/`):\n\n```\ncontrol img lowercase: Some image {src: \"x.png\", alt: \"A\", width: 200}\ncontrol anchor lowercase: Some((\"https://e.com\", Some(\"T\")))\ncontrol linked lowercase: Some image {src: \"x.png\", linkHref: \"https://e.com\"}\nIMG upper tag+attrs: None\nImg mixed tag, lower attrs: None\nimg lower tag, UPPER attrs: Some image {src: \"x.png\", alt: \"A\"}\nA upper anchor: None\nlinked upper: None\n```\n\n## Why it matters\n\nAn imported document whose images are written with uppercase or mixed-case tags silently loses them as images — worst case they render as a visible block of raw HTML. The attribute layer already honors HTML's case-insensitivity; the tag gate is the one place that doesn't, and nothing warns.\n\n## Acceptance criteria\n\n- `parse_img_tag`, `parse_anchor_tag`, and `parse_linked_img_tag` recognize tag names case-insensitively (e.g. `\u003cIMG>`, `\u003cImg>`, `\u003cA ...>...\u003c/A>`), while keeping the existing separator rules after the tag name.\n- Regression tests in web/markdown.rs cover an uppercase `\u003cIMG SRC=...>` block, a mixed-case inline `\u003cImg ...>`, and the uppercase linked `\u003cA HREF>\u003cIMG>\u003c/A>` form.\n- No behavior change for lowercase input (existing #872/#893 tests keep passing).\n\nRelated but distinct: #2187 (whitespace after the `\u003cimg` tag name — separator set, not case), #2180 (width/height dimension grammar in the same function), #2010 (TypeScript editor parseDOM side).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-29T09:11:21Z","url":"https://github.com/developing-today/code/issues/2201"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1dd293aa-55ca-b8b6-32fe-b5efe2630026 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A780:2E0249:835E0C:AAB1CF:6B062D37 |
| html-safe-nonce | cf33a887eb2903fe82d63c424bf54d0b74d06542535238c6fb61d4fec6a2e398 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzgwOjJFMDI0OTo4MzVFMEM6QUFCMUNGOjZCMDYyRDM3IiwidmlzaXRvcl9pZCI6IjIzMTg5NTc4MjI0OTY2MTU3MzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3deddc3d25ad6946802ae89e0077b30539682d0400ae8d26d696636e056998fb |
| hovercard-subject-tag | issue:6096512378 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/2201/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7e3b40c99d0ff2794184a7acd9c6da5912dfc9c26d92bd830b2046d8252e8c63/developing-today/code/issues/2201 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7e3b40c99d0ff2794184a7acd9c6da5912dfc9c26d92bd830b2046d8252e8c63/developing-today/code/issues/2201 |
| og:image:alt | Bug The HTML tag recognizers in pkgs/id/src/web/markdown.rs match the tag name case-sensitively, while HTML tag names are case-insensitive: parse_img_tag (markdown.rs:1190-1194) requires the litera... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 494ea0bb1e0feef734a83e2628697647755e8864 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width