[PATCH] Allow <dfn> tags in sanitize

Development-related discussion, including bundled plugins
User avatar
digitalcircuit
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 25 Jan 2017, 03:05

[PATCH] Allow <dfn> tags in sanitize

Postby digitalcircuit » 25 Jan 2017, 03:43

According to w3schools: HTML <dfn> Tag, <dfn> marks the defining instance of a term. It comes in a few variants, and might have a title attritibute, e.g.

Code: Select all

 <p><dfn title="HyperText Markup Language">HTML</dfn> is the standard markup language for creating web pages.</p>


I first noticed this in https://fox.blue/feed/atom, e.g.

Code: Select all

Indian tea harvests are divided up by <dfn>flush</dfn>.


TinyTiny-RSS currently strips this tag out, resulting in missing text, e.g.

Code: Select all

Indian tea harvests are divided up by .


My Gitlab username is digitalcircuit, and a simple patch is...

Code: Select all

sanitize: allow dfn tag

Add <dfn> tag to allowed tags list.  <dfn> represents the defining
instance of a term in HTML.
---
 include/functions2.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/functions2.php b/include/functions2.php
index f0e352e..ff4ac2c 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -978,7 +978,7 @@
       $allowed_elements = array('a', 'address', 'acronym', 'audio', 'article', 'aside',
          'b', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br',
          'caption', 'cite', 'center', 'code', 'col', 'colgroup',
-         'data', 'dd', 'del', 'details', 'description', 'div', 'dl', 'font',
+         'data', 'dd', 'del', 'details', 'description', 'dfn', 'div', 'dl', 'font',
          'dt', 'em', 'footer', 'figure', 'figcaption',
          'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'html', 'i',
          'img', 'ins', 'kbd', 'li', 'main', 'mark', 'nav', 'noscript',
--
2.7.4



I tried to follow the Contributing checklist; apologies in advance if I missed some steps. There's some other small sanitization/parsing related fixes, but to keep this focused, I'll save those for later merge requests.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [PATCH] Allow <dfn> tags in sanitize

Postby fox » 25 Jan 2017, 08:10

you should have proper gitlab permissions now

User avatar
digitalcircuit
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 25 Jan 2017, 03:05

Re: [PATCH] Allow <dfn> tags in sanitize

Postby digitalcircuit » 25 Jan 2017, 08:47

Thank you! That was rather quick.

For future development work, should I open a new forum thread first, or would it be sufficient to describe the details, examples, etc of a change in a new merge request?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [PATCH] Allow <dfn> tags in sanitize

Postby fox » 25 Jan 2017, 08:53

you don't have to bother with forum threads unless you want to discuss things first

User avatar
digitalcircuit
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 25 Jan 2017, 03:05

Re: [PATCH] Allow <dfn> tags in sanitize

Postby digitalcircuit » 25 Jan 2017, 08:58

Alright, that makes sense


Return to “Development”

Who is online

Users browsing this forum: No registered users and 3 guests