Commit 9b3ee10
committed
fix(parser): treat special chars as literals in macro attributes
Macro attributes (image, audio, video, icon) now parse `.`, `#`, `%` as literal characters
instead of interpreting them as shorthand syntax.
This matches asciidoctor behavior:
- `image::photo.jpg[Diablo 4 picture of Lilith.]` → trailing period preserved
- `image::photo.jpg[.role]` → ".role" is alt text, not a CSS class
- `image::photo.jpg[Issue #42]` → "#42" is literal, not an ID
Shorthand syntax (.role, #id, %option) remains supported only in block-level attribute
lines (e.g., `[.class]` before a block).
Also consolidates attribute processing logic between block and macro attributes into
shared helper functions.1 parent fe87550 commit 9b3ee10
2 files changed
+282
-74
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
0 commit comments