Skip to content

Clarify symbol boundary rules for digits#370

Open
dereuromark wants to merge 1 commit intojgm:mainfrom
dereuromark:symbol-time-format-boundary
Open

Clarify symbol boundary rules for digits#370
dereuromark wants to merge 1 commit intojgm:mainfrom
dereuromark:symbol-time-format-boundary

Conversation

@dereuromark
Copy link
Copy Markdown
Contributor

@dereuromark dereuromark commented Feb 5, 2026

Summary

  • Adds spec text clarifying that colons directly adjacent to digits on both sides do not open or close symbol syntax
  • This prevents time formats like 10:30:00 from being misinterpreted as containing symbols (e.g., :30:)

Partially addresses #350.

A reference implementation already exists in djot-php, closing the gap between upstream spec and downstream implementations.

Add spec text clarifying that colons directly adjacent to digits
on both sides do not open or close symbol syntax. This prevents
time formats like 10:30:00 from being misinterpreted as containing
symbols (e.g., :30:).

Addresses jgm#350.
@Omikhleia
Copy link
Copy Markdown

Omikhleia commented Feb 6, 2026

#350 also discussed (in comments) IPv6 addresses (say 2001:db8:0:1:1:1:1:1) and URNs (say urn:isbn:0143039431) so it's not really addressing it in full (and it cannot probably be addressed at all), just a very special corner case for time formats.

@dereuromark
Copy link
Copy Markdown
Contributor Author

You're right that this is a targeted fix for time formats specifically, not a complete solution for all colon-containing strings. IPv6 addresses and URNs are valid edge cases that this doesn't cover.

The digit-boundary rule was chosen because time formats (like 10:30:00) are by far the most common case where users unexpectedly hit symbol parsing. IPv6 and URNs are less common in prose and can be handled with escaping or raw/verbatim spans when needed.

A more comprehensive solution would risk breaking legitimate symbol uses. I've updated the PR description to clarify this addresses the time format case specifically.

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.

2 participants