Skip to content

Clean inline Markdown from chronicle narration - #628

Merged
100yenadmin merged 1 commit into
mainfrom
codex/chronicle-markdown-cleanup
Jun 3, 2026
Merged

Clean inline Markdown from chronicle narration#628
100yenadmin merged 1 commit into
mainfrom
codex/chronicle-markdown-cleanup

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Strip simple inline Markdown markers from player-facing Chronicle narration while preserving the underlying words and roll numbers.
  • Keep the cleanup in the existing read/projection sanitizeNarration path so engine/provider text and campaign state remain unchanged.
  • Add a behavior regression for the live-session symptom where a roll result rendered as raw **11** in the Chronicle.

Test Plan

  • python3 -m pytest viewer/tests/test_sanitize_narration.py::SanitizeNarrationTests::test_inline_markdown_emphasis_is_plain_text_for_players -q
  • python3 -m pytest viewer/tests/test_sanitize_narration.py -q
  • python3 -m pytest viewer/tests/test_openworlds_static.py -q
  • git diff --check

Notes

  • Browser-first product proof on current main stayed playable through opening narration, Look, and d20 click actions; this PR addresses the visible raw-formatting polish bug found in that proof.
  • This is not release/RRI evidence and does not change the engine-to-GUI write contract.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced narration sanitization to remove inline Markdown syntax from chronicle text, ensuring players see clean, properly formatted narration without visible emphasis markers.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@100yenadmin, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 11 minutes and 28 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d4afe984-351e-4c93-bbb4-050377059825

📥 Commits

Reviewing files that changed from the base of the PR and between e04d0d5 and ecd7f90.

📒 Files selected for processing (2)
  • viewer/openworlds/screen-table.jsx
  • viewer/tests/test_sanitize_narration.py
📝 Walkthrough

Walkthrough

The PR adds inline Markdown stripping to player-facing chronicle narration. A new _stripInlineMarkdown helper removes backticks and bold/italic/underline markers, which is integrated into the sanitizeNarration pipeline after internal-line filtering. A test validates that emphasis and code syntax are stripped while content is preserved.

Changes

Inline Markdown stripping from player-facing narration

Layer / File(s) Summary
Inline Markdown stripping implementation and test
viewer/openworlds/screen-table.jsx, viewer/tests/test_sanitize_narration.py
_stripInlineMarkdown helper removes backticks and bold/italic/underline markers; sanitizeNarration applies it to each non-internal line after scaffolding removal, preventing raw Markdown syntax in player output. Test case validates plain-text rendering of **bold**, *italic*, and `code` inputs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • electricsheephq/WorldOS#338: Both PRs modify sanitizeNarration() in screen-table.jsx—this PR strips inline Markdown emphasis/code markers, while the retrieved PR adds narration filtering to prevent DM-internal/advisory/tool leaks.
  • electricsheephq/WorldOS#349: Both PRs adjust sanitizeNarration for player-facing chronicle sanitization—this PR removes inline Markdown emphasis/code, while the retrieved PR removes DM scaffolding sentences.
  • electricsheephq/WorldOS#388: Both PRs expand sanitizeNarration narration filtering in screen-table.jsx—this PR adds inline Markdown stripping, while the retrieved PR integrates DM-advisory scene-debt filtering.

Poem

🐰 A rabbit hops through text so fine,
Removing asterisks and underscore signs,
Backticks vanish, bold text plain,
Players now see narration—no markdown stain! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: stripping inline Markdown from chronicle narration. It directly reflects the primary objective of the pull request.
Description check ✅ Passed The description includes a comprehensive summary of changes, test plan with specific commands, and relevant notes. However, the Licensing/CLA section is incomplete with unchecked checkboxes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@100yenadmin
100yenadmin force-pushed the codex/chronicle-markdown-cleanup branch 2 times, most recently from 5273c2c to 77488fb Compare June 3, 2026 01:28
@100yenadmin
100yenadmin force-pushed the codex/chronicle-markdown-cleanup branch from 77488fb to ecd7f90 Compare June 3, 2026 01:36
@100yenadmin
100yenadmin merged commit 2cba2a0 into main Jun 3, 2026
14 checks passed
@100yenadmin
100yenadmin deleted the codex/chronicle-markdown-cleanup branch June 3, 2026 01:39
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.

1 participant