<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-calendar-sync--sanitize-org-body.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-10T19:34:52+00:00</updated>
<entry>
<title>refactor(cj-org-text): extract Org-safe text sanitizers from calendar-sync</title>
<updated>2026-05-10T19:34:52+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-10T19:34:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=c44a52a7905b605a6537e3ff9bb4fe3afede0485'/>
<id>urn:sha1:c44a52a7905b605a6537e3ff9bb4fe3afede0485</id>
<content type='text'>
Phase 3 of utility-consolidation. Three sanitizers moved from calendar-sync.el into a new cj-org-text.el module so other consumers (web-clipper, AI conversation, mail-to-org capture) can compose Org content from external text without depending on calendar:

- `calendar-sync--sanitize-org-body' -&gt; `cj/org-sanitize-body-text'
- `calendar-sync--sanitize-org-property-value' -&gt; `cj/org-sanitize-property-value'
- `calendar-sync--sanitize-org-heading' -&gt; `cj/org-sanitize-heading'

The helpers stay pure (string in, string out, nil-safe) and have no Org-mode dependency, so they work in batch and in tests without loading Org.

Migrate calendar-sync.el to use the new public names: drop the three local defuns, add `(require \='cj-org-text)', update the six call sites in `calendar-sync--make-event-entry'.

Move the existing 17-test file to `tests/test-cj-org-text-sanitize.el', rename test names to match the new helpers, add 1 nil-input test for `cj/org-sanitize-heading' that wasn't in the original file. Total: 18 Normal/Boundary tests across the three helpers.
</content>
</entry>
<entry>
<title>fix: sanitize calendar event headings and property values</title>
<updated>2026-05-04T04:51:59+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-04T04:51:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=f610c2fef97381c7ecfc9dca0a0e1a39a16abe18'/>
<id>urn:sha1:f610c2fef97381c7ecfc9dca0a0e1a39a16abe18</id>
<content type='text'>
`calendar-sync--event-to-org` already cleaned the description body via `calendar-sync--sanitize-org-body`, but the event summary went into the heading line and the location, organizer, status, and URL went into the property drawer without sanitization. Any of those fields containing newlines could create extra Org headings, close the property drawer early with a stray `:END:`, or inject property-looking lines that the agenda would then parse as real properties.

I added two helpers. `calendar-sync--sanitize-org-property-value` trims the input and collapses any run of whitespace or newlines into a single space. `calendar-sync--sanitize-org-heading` composes that over the existing body sanitizer so `*` sequences also become `-`. The event-to-org function now routes the summary through the heading sanitizer and each property value through the property sanitizer.

I added regression tests across two files. `test-calendar-sync--sanitize-org-body.el` gets 4 new tests for the two helpers, covering newline flattening, leading-star replacement, structural-character flattening, and whitespace collapse. `test-calendar-sync--event-to-org.el` gets 2 new integration tests. A summary containing `\n** Hidden task` produces a single `* ` heading with the body inlined. A location containing `\n:END:\n* Not a real heading` collapses to a single property line with no extra `:END:` or heading injected.

515 calendar-sync tests pass together.
</content>
</entry>
<entry>
<title>fix(test): add missing testutil require for sanitize-org-body tests</title>
<updated>2026-02-06T22:20:45+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-02-06T19:51:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=a72d5015f268e726bbeed9f121d4cb62094f7b06'/>
<id>urn:sha1:a72d5015f268e726bbeed9f121d4cb62094f7b06</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix(calendar-sync): sanitize description text to prevent org heading corruption</title>
<updated>2026-02-06T16:15:08+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-02-06T16:15:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=6f2a854378b3b14d58cf4e567a3b1c5174484c12'/>
<id>urn:sha1:6f2a854378b3b14d58cf4e567a3b1c5174484c12</id>
<content type='text'>
Event descriptions containing lines starting with * were being interpreted
as org headings, breaking file structure. Replace leading asterisks with
dashes before writing descriptions.
</content>
</entry>
</feed>
