-
Notifications
You must be signed in to change notification settings - Fork 7
fix(render-helper): strip the Lumen "Posted via" byline #1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,14 @@ | ||
| export function cleanReply(s: string): string { | ||
| // scrobble.life's footer arrives as "---\n_Originally posted through [scrobble.life/..."; | ||
| // drop the separator too (lookahead keeps unrelated horizontal rules), otherwise the | ||
| // line filter below leaves a dangling <hr> at the end of the post. | ||
| const pre = s ? s.replace(/(^|\n)-{3,}[ \t]*\n+(?=[^\n]*originally posted through \[scrobble\.life)/i, '$1') : s | ||
| // scrobble.life ("---\n_Originally posted through [scrobble.life/...") and Lumen | ||
| // ("---\n*Posted via Lumen*" or "---\n*Posted via Lumen by <user>*") both put a separator | ||
| // right before their byline; drop it too (lookahead keeps unrelated horizontal rules), | ||
| // otherwise the line filters below leave a dangling <hr> at the end of the post. | ||
| const pre = s | ||
| ? s.replace( | ||
| /(^|\n)-{3,}[ \t]*\n+(?=[^\n]*(?:originally posted through \[scrobble\.life|\*posted via lumen))/i, | ||
| '$1' | ||
| ) | ||
| : s | ||
| return (pre ? pre.split('\n') | ||
| .filter(item => item.toLowerCase().includes('posted using [partiko') === false) | ||
| .filter(item => item.toLowerCase().includes('posted using [dapplr') === false) | ||
|
|
@@ -35,6 +41,7 @@ export function cleanReply(s: string): string { | |
| 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) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When ordinary prose contains an italicized phrase such as Useful? React with 👍 / 👎. |
||
| .filter(item => item.toLowerCase().includes('[via Inbox]') === false) | ||
| .filter(item => item.toLowerCase().includes('<sub>[via apps from](') === false) | ||
| .join('\n') : '') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Lumen filter strips inline prose
📎 Requirement gap≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools