Skip to content

feat: render Markdown and safe links in messages - #142

Merged
torlando-tech merged 23 commits into
mainfrom
fix/ios-markdown-links
Aug 4, 2026
Merged

feat: render Markdown and safe links in messages#142
torlando-tech merged 23 commits into
mainfrom
fix/ios-markdown-links

Conversation

@torlando-tech

Copy link
Copy Markdown
Owner

Summary

  • render received LXMF Markdown only when authenticated field 0x0F contains the exact integer renderer value 0x02
  • preserve plaintext for missing, malformed, unsupported, or non-integer renderer indications across live delivery and database reload
  • add safe HTTP/S and NomadNet links to Markdown and plaintext message bubbles, with NomadNet pages routed inside Columba
  • block remote Markdown images and unsafe URL schemes while keeping raw HTML inert
  • add compact chat-bubble Markdown styling, Swift syntax highlighting, and horizontally scrollable code blocks
  • pin MarkdownUI 2.4.1 and Splash 0.16.0 without raising the iOS 17 deployment target

Verification

  • swift test --filter MessageRendererTests - 2 passed
  • full ColumbaAppTests on iPhone 17 simulator - 197 passed
  • full ColumbaModelBAppTests compatibility suite - 21 passed
  • static CI contract suite - 92 passed
  • shipping and Model B simulator builds succeeded
  • Xcode package graph and exact resolved dependency pins verified
  • visual XCTest evidence reviewed for Markdown/plaintext gating, link contrast, blocked images, inert HTML, inline code, syntax-highlighted block code, and horizontal overflow

Risk and rollback

The behavior is receive-only and fails closed to plaintext. Removing the new package products and MessageBody integration restores the previous plaintext-only presentation.

Fixes #136
Fixes #141

@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds authenticated LXMF Markdown rendering and validated message links while preserving plaintext fallback for unsupported renderer values.

  • Maps renderer field 0x0F to Markdown only for exact integer value 0x02, including persisted-message restoration.
  • Adds Markdown styling, syntax-highlighted and horizontally scrollable code blocks, inert remote images, and scheme-restricted links.
  • Routes NomadNet links into the in-app browser at their requested path.
  • Adds and pins MarkdownUI 2.4.1 and Splash 0.16.0 for both application flavors.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code failure identified.

Renderer metadata is preserved across live and stored messages, unsupported values remain plaintext, validated link targets follow reachable handlers, and linked NomadNet paths flow into the browser’s initial fetch.

Important Files Changed

Filename Overview
Sources/ColumbaApp/Views/Messaging/MessageBody.swift Introduces renderer-specific message presentation, validated link parsing and routing, blocked image providers, Markdown styling, and code highlighting without an accepted defect.
Sources/ColumbaApp/Views/Messaging/MessageBubble.swift Threads renderer state and in-app link callbacks into message bubbles and restores renderer metadata from live and persisted LXMF fields.
Sources/ColumbaApp/Views/Messaging/MessagingView.swift Adds navigation from validated NomadNet message links to the browser while retaining unavailable-feature fallbacks.
Sources/ColumbaApp/ViewModels/NomadNetBrowserViewModel.swift Initializes browser state with the linked page path, which the existing initial-load lifecycle fetches correctly.
Sources/RNSAPI/Util/LxmfFields.swift Adds canonical renderer constants and strict integer-only Markdown selection with plaintext fallback.
Columba.xcodeproj/project.pbxproj Links the new shared message source and exact MarkdownUI/Splash products into both application flavors consistently.
Tests/ColumbaAppTests/MessageBubbleLayoutTests.swift Adds parser, renderer-restoration, image-blocking, and visual layout coverage for the new presentation behavior.
Tests/RNSAPITests/MessageRendererTests.swift Verifies exact integer Markdown gating and plaintext fallback for malformed or unsupported field values.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Received or persisted LXMF message] --> B{Renderer field 0x0F<br/>is exact integer 0x02?}
    B -- No --> C[Render plaintext]
    B -- Yes --> D[Render Markdown]
    C --> E[Detect validated links]
    D --> F[Intercept Markdown links]
    E --> G{Link target}
    F --> G
    G -- HTTP or HTTPS --> H[System browser]
    G -- LXMA --> I[Registered app deep link]
    G -- NomadNet --> J[In-app NomadNet browser]
    J --> K[Fetch requested initial path]
Loading

Reviews (1): Last reviewed commit: "fix: escape interpolation in code fixtur..." | Re-trigger Greptile

@torlando-tech
torlando-tech merged commit e51aca0 into main Aug 4, 2026
4 checks passed
@torlando-tech
torlando-tech deleted the fix/ios-markdown-links branch August 4, 2026 16:40
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.

android parity: link handling android parity: markdown rendering

1 participant