Handle fetch of text/plain as <pre>#8340
Merged
Alkarex merged 3 commits intoFreshRSS:edgefrom Dec 24, 2025
Merged
Conversation
Frenzie
reviewed
Dec 24, 2025
app/Utils/httpUtil.php
Outdated
| $body = self::enforceHtmlBase($body, $c_effective_url); | ||
| if (stripos($c_content_type, 'text/plain') !== false) { | ||
| // Plain text to be displayed as preformatted text. Prefixed with UTF-8 BOM | ||
| $body = "\xEF\xBB\xBF" . '<pre>' . htmlspecialchars($body, ENT_NOQUOTES, 'UTF-8') . '</pre>'; |
Member
There was a problem hiding this comment.
I'd probably add a class (not sure what exactly, something relating to extracted text perhaps?) so people can easily apply custom styles without affecting all PRE elements.
Member
There was a problem hiding this comment.
<pre class="plaintext"> maybe
Member
There was a problem hiding this comment.
I didn't like that so I didn't suggest it, but it might do. I was thinking something like extracted-text but I'm not fond of that either.
Member
Author
There was a problem hiding this comment.
Could <pre class="text-plain"> do?
Inverle
approved these changes
Dec 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #8328
Wrap
text/plainWeb scraping in a<pre>...</pre>