Skip to content

Fix: date/time-trigger syntax leaking into filename on "New note from Card" - #1222

Open
yhbarve wants to merge 1 commit into
community-archive:mainfrom
yhbarve:fix/new-note-date-in-filename
Open

Fix: date/time-trigger syntax leaking into filename on "New note from Card"#1222
yhbarve wants to merge 1 commit into
community-archive:mainfrom
yhbarve:fix/new-note-date-in-filename

Conversation

@yhbarve

@yhbarve yhbarve commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Fixes a bug where dates/times leak raw @{...} syntax into filenames (and get silently deleted from the card) when using "New note from card."

Fixes #1137.

The bug

The "New Note from Card" handler sanitized embeds, wikilinks, and tags when building the new note's filename, but never stripped date/time-trigger syntax (e.g. @{2026-07-15}). That raw syntax leaked directly into the generated filename and into the wikilink text inserted back into the card.

Before (bug):
Screenshot 2026-07-15 at 23 27 15

The fix

  • Stripped date/time tokens specifically for filename generation, using the same trigger-aware regex pattern already used by the existing "Remove date" menu action, so it respects custom date-trigger/time-trigger settings.
  • Also preserves the date/time on the card itself: rather than replacing the entire raw title line (date included) with the new link, only the date/time-free portion of the title is now matched and replaced — so the date badge survives right next to the link instead of being silently deleted.
  • Falls back to the original whole-line replacement if the title is only a date/time token, since there's no other text to anchor the link to.

After (fix):
Screenshot 2026-07-15 at 23 32 17

Testing

  • Verified with default @ date/time triggers and custom ones (e.g. @@@, $$)
  • Confirmed cards without dates are unaffected (filename and card text unchanged)
  • Confirmed the date badge survives conversion and daily-note links still work when link-date-to-daily-note is enabled

…card

Fixes community-archive#1137.

- The New note from card handler sanitized embeds, wikilinks, and tags
  when building the new note's filename, but never stripped date/time-
  trigger syntax (e.g. @{2026-07-15}). That raw syntax leaked directly
  into the generated filename and into the wikilink text inserted back
  into the card.
- Fixed by stripping date/time tokens specifically for filename
  generation.
- Also preserves the date/time on the card itself: rather than
  replacing the entire raw title line (date included) with the new
  link, only the date/time-free portion of the title is now matched
  and replaced, so the date badge survives right next to the link
  instead of being silently deleted.
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.

[Bug]: New note from card

1 participant