You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preserve # prefix for unresolved cross-references (#1676)
## Summary
When `#name` doesn't resolve to a method, the cross-reference handler
was stripping the `#` and returning just the name. Now the original text
including `#` is restored when the lookup fails.
This fixes rendering of text like `#no-space-heading` in Markdown
paragraphs, where the `#` was silently dropped in the final HTML.
### Refactoring
- `cross_reference` no longer mutates its `name` parameter; uses a
separate `display` variable for `#`-stripped text
- `link` returns `nil` for unresolved references instead of returning
bare text, letting the caller decide what to display
- Label handling is hoisted out of the `case` branches so it's shared
between resolved refs and bare label references (`@foo`)
- Move new test methods before `private` helper section to follow file
convention
Found while investigating blockquote lazy continuation in #1627 —
`#text` (not a valid heading) inside a blockquote was rendered without
the `#`.
0 commit comments