Skip to content

feat: Add description to ICS events#168

Open
DoomHammer wants to merge 1 commit intomainfrom
add-description-to-events
Open

feat: Add description to ICS events#168
DoomHammer wants to merge 1 commit intomainfrom
add-description-to-events

Conversation

@DoomHammer
Copy link
Copy Markdown
Member

No description provided.

@DoomHammer DoomHammer requested a review from reinhrst December 15, 2025 12:25
@DoomHammer DoomHammer self-assigned this Dec 15, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 15, 2025

Deploy Preview for test-hs3 ready!

Name Link
🔨 Latest commit 0f759b2
🔍 Latest deploy log https://app.netlify.com/projects/test-hs3/deploys/694002a0c124630008b898bb
😎 Deploy Preview https://deploy-preview-168--test-hs3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@DoomHammer DoomHammer force-pushed the add-description-to-events branch from 7554f39 to 0f759b2 Compare December 15, 2025 12:44
@reinhrst
Copy link
Copy Markdown
Collaborator

Sooo, gut feeling says that this will be an issue if the description contains any non-ascii characters. Good thing that Polish hardly uses non-ascii :|. Also supposedly = should be escaped as well.

So other Claude suggests some fixes, although as always with AI it may be good to check if they make sense / are better / if it's actually broken now:

ClaudeAI:

Better Solutions

Option 1: Simple iCal escaping (recommended)

Drop QUOTED-PRINTABLE and use standard iCal escaping instead:

DESCRIPTION:{{ $event.page.Content | replaceRE `\\` `\\\\` | replaceRE `;` `\;` | replaceRE `,` `\,` | replaceRE `\n` `\n ` }}

This escapes backslashes, semicolons, commas, and folds newlines (iCal uses space-prefixed continuation lines).

Option 2: Proper Quoted-Printable (complex)

Hugo doesn't have built-in QP encoding, so you'd need to create a custom shortcode or use a pre-processing step with a tool that properly encodes QP.

Option 3: Plain text with basic escaping

DESCRIPTION:{{ $event.page.Content | plainify | replaceRE `\n` `\\n` }}

The plainify removes HTML, and \\n is the iCal escape sequence for newlines.

I'd recommend Option 1 or 3 depending on whether you need to preserve HTML formatting or not. Both handle Unicode properly without additional encoding.

@DoomHammer
Copy link
Copy Markdown
Member Author

Yeah, I can already see that different implementations might have different ways of parsing this.

It's a first step, though!

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