Skip to content

Strip red-letter tags from devotionals#40

Open
vanities wants to merge 1 commit into
masterfrom
codex/fix-jesus-content-in-devotionals
Open

Strip red-letter tags from devotionals#40
vanities wants to merge 1 commit into
masterfrom
codex/fix-jesus-content-in-devotionals

Conversation

@vanities

@vanities vanities commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Devotional prose was rendering raw <JESUS>/</JESUS> red-letter markers (which are intended for verse rendering) and these tags appeared in devotionals, notifications, and saved snippets.

Description

  • Add a cleanedForDisplay computed copy on DailyDevotional that returns a copy with the message sanitized for prose display.
  • Add String.removingRedLetterTags() which strips <JESUS>/</JESUS> (case/whitespace tolerant) via a regex while preserving the quoted words.
  • Use the cleaned message when applying fetched devotionals to the UI, when saving to/reading from the devotional cache, and when building notification teasers so red-letter tags no longer leak into UI/notifications; also sanitize saved favorites before insertion.
  • Add unit tests ios/swiftbibleTests/DailyDevotionalTests.swift to cover normal tags, whitespace/case variants, and that cleanedForDisplay preserves non-message fields.

Testing

  • Added DailyDevotionalTests to the test target but tests were not executed here because xcodebuild is not available in this environment.
  • Ran make test-ios in this environment and it failed due to the Make target using set -o pipefail under /bin/sh (unsupported here).
  • Ran swiftlint check but it could not run because swiftlint is not installed in this environment.
  • All changes were smoke-validated in the repo (files updated and a commit created) and unit tests are present and ready to run in CI/locally where Xcode and SwiftLint are available.

Codex Task

Summary by CodeRabbit

Release Notes

  • New Features

    • Devotional messages now display with improved text formatting across the app, including in the daily view, cached content, and notification previews.
  • Tests

    • Added unit tests to verify text formatting enhancements.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9cdab023-1e07-4448-9a5a-3fde989513b7

📥 Commits

Reviewing files that changed from the base of the PR and between 7d5b705 and 2383f95.

📒 Files selected for processing (5)
  • ios/swiftbible/Models/DailyDevotional.swift
  • ios/swiftbible/Services/CacheService.swift
  • ios/swiftbible/Services/NotificationService.swift
  • ios/swiftbible/Views/Daily Devotional/DailyDevotionalView.swift
  • ios/swiftbibleTests/DailyDevotionalTests.swift

📝 Walkthrough

Walkthrough

DailyDevotional gains Equatable conformance, a cleanedForDisplay computed property, and a String.removingRedLetterTags() helper that strips <JESUS>-style markup via regex. CacheService, NotificationService, and DailyDevotionalView are updated to use the cleaned representation for persistence, notifications, and display/favorites.

Changes

Red-letter tag stripping

Layer / File(s) Summary
Model: Equatable, cleanedForDisplay, removingRedLetterTags, and tests
ios/swiftbible/Models/DailyDevotional.swift, ios/swiftbibleTests/DailyDevotionalTests.swift
DailyDevotional adds Equatable, a cleanedForDisplay computed property that copies all fields while stripping <JESUS> markup from message, and a String.removingRedLetterTags() regex helper. Three unit tests cover basic removal, case/whitespace variants, and field isolation in cleanedForDisplay.
Integration: cache, notification, and view
ios/swiftbible/Services/CacheService.swift, ios/swiftbible/Services/NotificationService.swift, ios/swiftbible/Views/Daily Devotional/DailyDevotionalView.swift
CacheService.saveDevotional encodes devotional.cleanedForDisplay and loadDevotional returns devotional.cleanedForDisplay. NotificationService.buildContent uses devotional.cleanedForDisplay.message for the notification body. DailyDevotionalView reads the cleaned message for display, caches the cleaned devotional on miss, and saves message.removingRedLetterTags() to SavedDevotional on favorite.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hopping through the holy text with care,
I snip the tags that float in morning air —
<JESUS> gone, the words remain in grace,
Clean messages displayed in every place.
My regex burrows swift and true, hooray! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Strip red-letter tags from devotionals' directly and accurately summarizes the main change: removing red-letter HTML tags from devotional content displayed to users.
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.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-jesus-content-in-devotionals

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

1 participant