Skip to content

Format notes: headings, lists, tasks, clickable links; full-width note field - #10

Open
erorplex wants to merge 2 commits into
mainfrom
feat/note-formatting
Open

erorplex wants to merge 2 commits into
mainfrom
feat/note-formatting

Conversation

@erorplex

Copy link
Copy Markdown
Owner

What

  • Full width: the thread bar stretches across Gmail's subject header (align-self: stretch, width: 100%), so the note no longer shrinks to the button row; max-width: 760px removed. The field grows with its text.
  • Formatted view: a small Markdown subset in src/note.js – #–### headings, -/* bullets, 1. lists, - [ ] tasks, **bold**, *italic*, `code`, [text](url) and bare URLs.
  • Edit/read: a note with text is shown formatted; clicking it (outside links/checkboxes) opens the textarea, Esc or blur shows it formatted again. Ticking a task writes [x] back into the text and saves.
  • Storage, popup search and export are unchanged – notes stay plain text.

Security

  • Rendering uses createElement/textContent only (Gmail enforces Trusted Types anyway); no innerHTML.
  • Links only for http, https, mailto (www. → https://); others stay text. target=_blank rel="noopener noreferrer".
  • Unit tests cover javascript:/data: links and HTML in notes; e2e checks that <b> stays text.

Tests

  • npm test: 31 passed (7 new in test/note.test.js)
  • npm run test:e2e: 9 passed, incl. a new test for the formatted view, link href and task toggle saving

Not yet checked in real Gmail (only the mocked fixture), in particular the width fix against Gmail's real header.

🤖 Generated with Claude Code

erorplex and others added 2 commits September 30, 2026 11:44
…e field

Notes are parsed with a small Markdown subset (src/note.js) and rendered with
createElement/textContent only; links are limited to http, https and mailto.
A click on the formatted note edits the plain text, Esc or blur shows it
formatted again. Task checkboxes write back into the text. The thread bar
stretches to the full width of Gmail's subject header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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