Skip to content

Clarify: emphasis delimiters inside link destinations are literal#378

Open
dereuromark wants to merge 1 commit intojgm:mainfrom
dereuromark:fix/emphasis-in-link-destinations
Open

Clarify: emphasis delimiters inside link destinations are literal#378
dereuromark wants to merge 1 commit intojgm:mainfrom
dereuromark:fix/emphasis-in-link-destinations

Conversation

@dereuromark
Copy link
Copy Markdown
Contributor

@dereuromark dereuromark commented Feb 8, 2026

Related: #375
JS implementation fix: jgm/djot.js#125
PHP implementation fix: php-collective/djot-php#81

Summary

Adds a clarifying note to the Precedence section of the syntax spec explaining that inline formatting delimiters inside link destinations are treated as literal text.

This covers the destination-only case:

  • _ or * inside a URL like (http://example.com?foo_bar=1) does not participate in emphasis matching

The bracket-text case (_[bar_](url)) is intentionally not changed - emphasis continues to take precedence per the existing "first to start wins" rule.

Per discussion in #375, this is the simpler fix that addresses the main real-world issue (URLs with underscores in query params) without the complexity of lookahead parsing.

@dereuromark dereuromark marked this pull request as ready for review February 8, 2026 16:54
@dereuromark dereuromark force-pushed the fix/emphasis-in-link-destinations branch from bdb9094 to 038b426 Compare February 8, 2026 17:13
Add a note to the Precedence section explaining that inline formatting
delimiters inside link destinations (URLs in parentheses) are treated
as literal text and don't participate in emphasis matching.

See jgm#375
@dereuromark dereuromark force-pushed the fix/emphasis-in-link-destinations branch from 038b426 to c854d7c Compare February 17, 2026 14:01
@dereuromark
Copy link
Copy Markdown
Contributor Author

@jgm This appears to still be open. I think with the merge of the others this should be good to go now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant