Skip to content

Conversation

@mikepenz
Copy link
Owner

Description

Fix *, _, ~ in inline comment

Fixes # #475

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build configuration change
  • Other (please describe):

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the rendering of special markdown characters (*, _, ~) when they appear inside inline code blocks. Previously, these characters were incorrectly being interpreted as markdown formatting markers even when enclosed in backticks.

Key changes:

  • Modified the EMPH token handler to use getTextInNode() to preserve raw characters in inline code
  • Added special handling for ~ tokens in the else clause to display them literally when not part of strikethrough formatting
  • Added comprehensive snapshot tests to verify the fix works for both Material 2 and Material 3 themes

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/annotator/AnnotatedStringKtx.kt Core fix for rendering special markdown characters literally in inline code by using getTextInNode() instead of treating them as formatting tokens
sample/android/src/screenshotTest/kotlin/com/mikepenz/markdown/ui/m3/SnapshotTests.kt Added InlineCodeTest with test data to validate the fix for Material 3 theme
sample/android/src/screenshotTest/kotlin/com/mikepenz/markdown/ui/m2/SnapshotTests.kt Added InlineCodeTest with test data to validate the fix for Material 2 theme
MIGRATION.md Updated migration notes for version 0.39.0 with breaking changes and dependency upgrades

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mikepenz mikepenz merged commit 089bed4 into develop Dec 19, 2025
9 checks passed
@mikepenz mikepenz deleted the fix/475 branch December 19, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants