Skip to content
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

Add bbcode support in rss description #2428

Merged
merged 2 commits into from
Jan 29, 2023

Conversation

TrimmingFool
Copy link
Contributor

@TrimmingFool TrimmingFool commented Jan 1, 2023

Wishing everyone a happy New Year!

Sometimes rss feeds include bbcode https://www.bbcode.org/reference.php.
I expect bbcode usage to mainly be limited to [i] or [b] and thus full bbcode support may not really be needed.

Nevertheless, I included support for [list]/[ul] tags and some style options. For instance:

[style color=#0000FF font=times size=18 align=center]Text[/style]

translates to:

<span class="bbcode-color bbcode-font-times bbcode-size bbcode-align-center" style="color: #0000FF; font-size: 18px">Text</span>

Only bbcode styles and classes are allowed and other styles are restricted by Sanitize.
Additionally, there would be support for [img]...[/img] to <img src=.../> and [url]...[/url] to <a href=...>...</a> but these are removed (as they should) by the Sanitize.Config.RESTRICTED config.

Further, I added a Raw toggle for showing the raw html rss description in the rsslayout .

@TrimmingFool
Copy link
Contributor Author

Since some users may want to have a less restricted view as in #2426, I added a setting to configure the desired sanitization level (RESTRICTED, BASIC, RELAXED).

@stickz
Copy link
Collaborator

stickz commented Jan 3, 2023

@TrimmingFool Could you move the RSS sanitation level changes to anther pull request? Code review is too difficult.

@stickz
Copy link
Collaborator

stickz commented Jan 5, 2023

Work in Progress label added. Pull request is dependant on other pull requests.

@TrimmingFool TrimmingFool marked this pull request as draft January 5, 2023 15:16
@TrimmingFool TrimmingFool changed the base branch from master to develop January 8, 2023 15:00
@TrimmingFool TrimmingFool changed the title add bbcode support in rss description Add bbcode support in rss description Jan 8, 2023
@TrimmingFool TrimmingFool marked this pull request as ready for review January 29, 2023 15:47
@stickz
Copy link
Collaborator

stickz commented Jan 29, 2023

It looks like you've done everything possible to test bbcode support. Merging into develop branch. Thanks.

@stickz stickz merged commit 518e98f into Novik:develop Jan 29, 2023
stickz added a commit that referenced this pull request Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants