Skip to content

Conversation

@FrankLedo
Copy link
Contributor

Summary

Implements GitHub-flavored markdown alerts support for markdown-confluence-sync.

Closes #70

Changes

  • Add rehype-replace-alerts.ts plugin with alert type detection and transformation
  • Add rehype.alerts configuration option (disabled by default)
  • Integrate plugin into ConfluencePageTransformer pipeline
  • Add comprehensive unit tests covering all alert types and edge cases
  • Update README with feature documentation and examples
  • Update CHANGELOG with feature description
  • Bump package version to 2.4.0

Implementation Details

The implementation follows the same architecture pattern as the recently added code blocks feature (#65):

  • New rehype plugin transforms GitHub alert syntax to Confluence macros
  • Opt-in feature controlled by rehype.alerts configuration option
  • Default disabled for backward compatibility
  • Supports all five GitHub alert types: NOTE, TIP, IMPORTANT, WARNING, CAUTION

Testing

  • All unit tests pass (19 test cases covering edge cases)
  • Linter passes without errors
  • Follows repository standards (SPDX headers, semantic versioning)
  • TypeScript types properly defined

Documentation

  • README updated with feature description and examples
  • CHANGELOG updated in unreleased section
  • Configuration option documented in options table
  • JSDoc comments added to all functions

javierbrea and others added 4 commits November 24, 2025 11:16
…acros

Implement rehype plugin to convert GitHub-flavored markdown alerts
([!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION]) to Confluence's
native info, note, warning, and tip macros.

Changes:
- Add rehype-replace-alerts.ts plugin with alert type detection and transformation
- Add rehype.alerts configuration option (disabled by default)
- Integrate plugin into ConfluencePageTransformer pipeline
- Add comprehensive unit tests covering all alert types and edge cases
- Update README with feature documentation and examples
- Update CHANGELOG with feature description
- Bump package version to 2.4.0
GitHub alerts in markdown produce blockquotes with leading whitespace text
nodes when parsed. This fix skips whitespace-only text nodes to find the
actual content, supporting both:
- Direct text nodes with alert markers
- Paragraph-wrapped content with alert markers

Fixes issue where alerts were not being detected and transformed.
@javierbrea
Copy link
Collaborator

Thank you so much!
We're very happy to include this feature — the implementation is clean, well-tested, and perfectly aligned with the project’s architecture.

We'll cut a new release as soon as possible so this can be available to everyone.
Really appreciate the work and attention to detail! 🚀

@javierbrea javierbrea changed the base branch from release to feat/70/github-alerts November 27, 2025 09:50
@javierbrea javierbrea self-assigned this Nov 27, 2025
@javierbrea javierbrea self-requested a review November 27, 2025 09:51
Copy link
Collaborator

@javierbrea javierbrea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 I will merge it into a branch with the same name in this repository to run some E2E tests before adding it to the release branch.

@javierbrea javierbrea merged commit 46a32a6 into Telefonica:feat/70/github-alerts Nov 27, 2025
8 of 11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants