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
Documents a survey of upstream jupyter-book/mystmd issues and discussions around overzealous citation @-parsing, and how our code-span guard (#46, implemented in PR #53) relates to it. No action required — this is reference material for the eventual upstream PR.
One maintainer comment (agoose77, Nov 2024) leaning toward explicit escaping (\@rowanc1): "treating @ as special is probably the easiest to reason about"
Data-structure design discussion; also questions whether pandoc [@key] syntax is the settled direction
The inline-code-span shape is unreported upstream — no issue covers an @-token enclosed in backticks inside a bracket. Our #46 / PR #53 is therefore complementary to all in-flight upstream work, not in conflict with any of it.
Why the escaping philosophy does not cover our case
The only stated upstream stance (jupyter-book#1618 comment) is user-side escaping. That cannot work for the code-span shape:
In CommonMark, backslashes inside code spans are literal — `\@tf.function` renders the backslash. There is no way to escape an @ inside backticks.
The only available workaround is escaping the bracket (**\[NEW: …), which is non-obvious and changes link semantics — this is what the Deep_Learning book's conversion currently does, and what PR Citation scanner respects inline code-span boundaries #53 makes unnecessary.
Code spans binding tighter than brackets is CommonMark's own inline precedence; the guard restores spec-consistent behavior rather than adding a heuristic.
So even if upstream resolves jupyter-book#1618 via escaping, the code-span guard remains necessary and orthogonal. Conversely, upstream's merge history on citations.ts (jupyter-book#2684, jupyter-book#2891) shows repeated acceptance of exactly this kind of context-narrowing fix, so the cherry-pick has good precedent.
How this feeds the upstream PR
When PR #53's squash commit is added to quantecon/UPSTREAM-PRS.yml, the candidate notes should carry:
the escape-impossibility argument above (the core of the upstream pitch),
Documents a survey of upstream jupyter-book/mystmd issues and discussions around overzealous citation
@-parsing, and how our code-span guard (#46, implemented in PR #53) relates to it. No action required — this is reference material for the eventual upstream PR.Upstream landscape (as of 2026-06-12)
bug[@handle](url)link labels\@rowanc1): "treating@as special is probably the easiest to reason about"hackmd.io/@user/…)isUrlContext/isLinkContextguards now incitations.ts@mentionfollowed by inline HTMLmyst-clidois.ts), not the parser[@key]syntax is the settled directionThe inline-code-span shape is unreported upstream — no issue covers an
@-token enclosed in backticks inside a bracket. Our #46 / PR #53 is therefore complementary to all in-flight upstream work, not in conflict with any of it.Why the escaping philosophy does not cover our case
The only stated upstream stance (jupyter-book#1618 comment) is user-side escaping. That cannot work for the code-span shape:
`\@tf.function`renders the backslash. There is no way to escape an@inside backticks.**\[NEW: …), which is non-obvious and changes link semantics — this is what the Deep_Learning book's conversion currently does, and what PR Citation scanner respects inline code-span boundaries #53 makes unnecessary.So even if upstream resolves jupyter-book#1618 via escaping, the code-span guard remains necessary and orthogonal. Conversely, upstream's merge history on
citations.ts(jupyter-book#2684, jupyter-book#2891) shows repeated acceptance of exactly this kind of context-narrowing fix, so the cherry-pick has good precedent.How this feeds the upstream PR
When PR #53's squash commit is added to
quantecon/UPSTREAM-PRS.yml, the candidate notes should carry:@mentionfollowed by html parsing bug jupyter-book/mystmd#2891).We decided not to file an upstream issue pre-emptively; the context lands with the upstream PR itself.