Skip to content

fix(render-helper): strip the Lumen "Posted via" byline - #1728

Merged
feruzm merged 2 commits into
developfrom
fix/render-helper-lumen-byline
Sep 6, 2026
Merged

fix(render-helper): strip the Lumen "Posted via" byline#1728
feruzm merged 2 commits into
developfrom
fix/render-helper-lumen-byline

Conversation

@feruzm

@feruzm feruzm commented Sep 4, 2026

Copy link
Copy Markdown
Member

Closes #1727

Lumen (app lumen/1.0) appends ---\n*Posted via Lumen* to every post and comment, with a by <user> suffix for lite accounts posting through a container. This adds it to the app-footer filters in cleanReply and extends the separator lookahead introduced for scrobble.life so the --- directly before the byline is dropped too. Unrelated horizontal rules are untouched. The marker includes the leading asterisk so a body that merely mentions posting via Lumen is not stripped.

Test plan

  • New specs: plain footer, by <user> footer, unrelated hr preserved, plain mention preserved.
  • Mutation check: removing the line filter or the lookahead extension fails three specs each.
  • Real bodies from @hbd-temp and @lumenpublisher rendered through markdown2Html contain no byline and no <hr>.
  • vitest run in packages/render-helper: 24 files, 1332 tests green. eslint and tsc clean.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 8630614b-e1c5-464a-b1f3-cd8cdf243786


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.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Strip Lumen bylines and adjacent separators from rendered replies

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Removes Lumen-generated bylines from posts and comments during reply cleaning.
• Drops only separators immediately preceding recognized Lumen or scrobble.life footers.
• Adds regression coverage for lite accounts, false positives, and horizontal-rule preservation.
Diagram

graph TD
  A["Reply Markdown"] --> B{"Known footer?"} -- Yes --> C["Remove separator"] --> D["Filter bylines"] --> E["Clean reply"]
  B -- No --> D
Loading
High-Level Assessment

Extending the existing cleanReply footer pipeline is appropriate because Lumen uses the same separator-plus-byline structure already handled for scrobble.life. Matching the leading Markdown asterisk and coupling separator removal to a lookahead avoids stripping ordinary Lumen mentions or unrelated horizontal rules; broader substring removal or a new parser would add risk and complexity without benefit.

Files changed (2) +45 / -4

Bug fix (1) +11 / -4
clean-reply.method.tsRemove Lumen bylines and their adjacent separators +11/-4

Remove Lumen bylines and their adjacent separators

• Extends separator lookahead detection to recognize Lumen footer markers alongside scrobble.life. Adds a targeted line filter for Lumen bylines, including optional lite-account attribution suffixes.

packages/render-helper/src/methods/clean-reply.method.ts

Tests (1) +34 / -0
clean-reply.method.spec.tsCover Lumen footer removal and false-positive safeguards +34/-0

Cover Lumen footer removal and false-positive safeguards

• Adds regression tests for standard and lite-account Lumen bylines. Verifies that the attached separator is removed while unrelated horizontal rules and ordinary Lumen mentions remain intact.

packages/render-helper/src/methods/clean-reply.method.spec.ts

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 4, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (1) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Lumen filter strips inline prose 📎 Requirement gap ≡ Correctness
Description
The new Lumen cleanup filter removes every line containing *posted via lumen, including ordinary
user-authored prose such as I *posted via Lumen yesterday*, instead of only footer lines beginning
with that marker. Because cleanReply processes complete post bodies and summaries, this can
silently delete legitimate content and violate the requirement to preserve non-footer mentions.
Code

packages/render-helper/src/methods/clean-reply.method.ts[44]

+    .filter(item => item.toLowerCase().includes('*posted via lumen') === false)
Evidence
The changed filter matches *posted via lumen anywhere in a line, while the compliance rule
requires matching footer content that begins with the marker. cleanReply applies these
unconditional substring filters to every newline-separated body line, and rendering paths pass
complete post bodies and summaries through it; existing preservation coverage checks only an
unitalicized mention and does not cover the exact marker substring or a preceding horizontal rule.

Strip Lumen footer bylines in cleanReply
packages/render-helper/src/methods/clean-reply.method.ts[44-44]
packages/render-helper/src/methods/clean-reply.method.ts[12-47]
packages/render-helper/src/markdown-2-html.ts[53-75]
packages/render-helper/src/post-body-summary.ts[60-67]
packages/render-helper/src/methods/clean-reply.method.spec.ts[280-285]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Update the Lumen cleanup filter so it removes only actual footer lines whose content begins with `*posted via lumen`, while preserving ordinary prose that quotes, discusses, or otherwise contains the italicized phrase. Ensure the separator lookahead uses the same footer-specific matching rule so a preceding horizontal rule is not removed for ordinary content.
## Issue Context
Compliance ID 1 requires plain and proxied-user Lumen footers to be removed while ordinary mentions remain intact. `cleanReply` processes complete post bodies and post summaries, so an unrestricted substring match can cause user content to disappear. Add coverage for prose containing the italicized phrase and for a horizontal rule before such prose, while preserving removal of the actual footer and its optional `by <user>` suffix.
## Fix Focus Areas
- packages/render-helper/src/methods/clean-reply.method.ts[8-10]
- packages/render-helper/src/methods/clean-reply.method.ts[44-44]
- packages/render-helper/src/methods/clean-reply.method.spec.ts[280-285]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

return !(l.includes('posted from liketu speak') && l.includes('auto-transcrib'));
})
.filter(item => item.toLowerCase().includes('originally posted through [scrobble.life') === false)
.filter(item => item.toLowerCase().includes('*posted via lumen') === false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Lumen filter strips inline prose 📎 Requirement gap ≡ Correctness

The new Lumen cleanup filter removes every line containing *posted via lumen, including ordinary
user-authored prose such as I *posted via Lumen yesterday*, instead of only footer lines beginning
with that marker. Because cleanReply processes complete post bodies and summaries, this can
silently delete legitimate content and violate the requirement to preserve non-footer mentions.
Agent Prompt
## Issue description
Update the Lumen cleanup filter so it removes only actual footer lines whose content begins with `*posted via lumen`, while preserving ordinary prose that quotes, discusses, or otherwise contains the italicized phrase. Ensure the separator lookahead uses the same footer-specific matching rule so a preceding horizontal rule is not removed for ordinary content.

## Issue Context
Compliance ID 1 requires plain and proxied-user Lumen footers to be removed while ordinary mentions remain intact. `cleanReply` processes complete post bodies and post summaries, so an unrestricted substring match can cause user content to disappear. Add coverage for prose containing the italicized phrase and for a horizontal rule before such prose, while preserving removal of the actual footer and its optional `by <user>` suffix.

## Fix Focus Areas
- packages/render-helper/src/methods/clean-reply.method.ts[8-10]
- packages/render-helper/src/methods/clean-reply.method.ts[44-44]
- packages/render-helper/src/methods/clean-reply.method.spec.ts[280-285]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35edb74227

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return !(l.includes('posted from liketu speak') && l.includes('auto-transcrib'));
})
.filter(item => item.toLowerCase().includes('originally posted through [scrobble.life') === false)
.filter(item => item.toLowerCase().includes('*posted via lumen') === false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict the Lumen filter to the actual footer

When ordinary prose contains an italicized phrase such as I *posted via Lumen* yesterday, this substring predicate removes the entire line. Because cleanReply processes all rendered bodies rather than only entries tagged lumen/1.0, legitimate non-footer content is lost; anchor the match to the complete terminal byline, including its closing * and optional by ... suffix.

Useful? React with 👍 / 👎.

@feruzm feruzm added the patch Bug fixes and patches (1.0.0 → 1.0.1) label Sep 6, 2026
@feruzm
feruzm merged commit 304d82c into develop Sep 6, 2026
12 checks passed
@feruzm
feruzm deleted the fix/render-helper-lumen-byline branch September 6, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes and patches (1.0.0 → 1.0.1)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

render-helper: strip the Lumen "Posted via" byline in cleanReply

1 participant