Skip to content

Conversation

luandro
Copy link
Contributor

@luandro luandro commented Oct 10, 2025

Summary

  • add restoreSoftLineBreaks to translate Notion soft breaks into <br />
  • wire the helper into markdown export so Shift+Enter survives publishing
  • extend unit coverage and mocks for the new helper

Testing

  • bunx vitest run scripts/notion-fetch/contentSanitizer.test.ts
  • bunx vitest run scripts/notion-fetch/generateBlocks.test.ts

Closes #47

@luandro
Copy link
Contributor Author

luandro commented Oct 11, 2025

Verification Notes

  • restoreSoftLineBreaks() now runs right after markdown sanitization (scripts/notion-fetch/generateBlocks.ts:1550), converting single in-paragraph newlines into <br /> while skipping markdown structures. That preserves Shift+Enter breaks from Notion during export.
  • Helper is exported via scripts/notion-fetch/utils.ts so downstream code can share it, and unit coverage exercises normal breaks, double breaks, list markers, fenced code, and Notion Unicode separators (scripts/notion-fetch/contentSanitizer.test.ts).

How to test locally

  1. In Notion, insert text with a manual line break (Shift+Enter) on a test page.
  2. Run the standard sync that regenerates docs (e.g. bun scripts/notion-fetch with your usual filters).
  3. Inspect the regenerated markdown under docs/...; the manual break should appear as <br />, and render the same on the site.
  4. Optional: run bunx vitest run scripts/notion-fetch/contentSanitizer.test.ts --runInBand --reporter=dot to see the new helper tests pass.

@digidem digidem deleted a comment from github-actions bot Oct 11, 2025
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.

Soft line breaks are not translating from Notion

1 participant