12
167
Fork
You've already forked fnott
32

Html entities #135

Closed
opened 2024年10月25日 19:02:16 +02:00 by tr147 · 2 comments

Notifications from Claws Mail keep the &lt;and &gt;. Shouldn't decode_html_entities replace them with < and >?

I'm using fnott v1.7.0 on FreeBSD.

Notifications from Claws Mail keep the `&lt;`and `&gt;`. Shouldn't decode_html_entities replace them with < and >? I'm using fnott v1.7.0 on FreeBSD.
Author
Copy link

It seems, that fnott uses obsolete ("basic") regular expressions, but then is '|' an ordinary character and there is no equivalent for its functionality.

When i compiled regular expression as modern ("extended") RE, then decode_html_entities started to work:

int r = regcomp(
 &mgr->html_entity_re,
 /* Entity names (there's a *lot* of these - we only support the common ones */
 "&(nbsp|lt|gt|amp|quot|apos|cent|pound|yen|euro|copy|reg);|"
 /* Decimal entity number: &#39; */
 "&#([0-9]+);|"
 /* Hexadecimal entity number: &#x27; */
 "&#x([0-9a-fA-F]+);", REG_EXTENDED);
It seems, that fnott uses obsolete ("basic") regular expressions, but then is `'|'` an ordinary character and there is no equivalent for its functionality. When i compiled regular expression as modern ("extended") RE, then `decode_html_entities` started to work: ``` int r = regcomp( &mgr->html_entity_re, /* Entity names (there's a *lot* of these - we only support the common ones */ "&(nbsp|lt|gt|amp|quot|apos|cent|pound|yen|euro|copy|reg);|" /* Decimal entity number: &#39; */ "&#([0-9]+);|" /* Hexadecimal entity number: &#x27; */ "&#x([0-9a-fA-F]+);", REG_EXTENDED); ```
Owner
Copy link

We can switch to an extended expression. The current one works just fine on Linux, so there must be some different in the regex implementations in glibc and FreeBSD's libc.

We can switch to an extended expression. The current one works just fine on Linux, so there must be some different in the regex implementations in glibc and FreeBSD's libc.
Sign in to join this conversation.
No Branch/Tag specified
master
releases/1.8
releases/1.7
releases/1.6
releases/1.5
release/1.4
parse-font-apply-fontconfig-rules
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.8.0
1.7.1
1.7.0
1.6.0
1.5.0
1.4.1
1.4.0
1.3.0
1.2.1
1.2.0
1.1.2
1.1.1
1.1.0
1.0.1
1.0.0
0.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/fnott#135
Reference in a new issue
dnkl/fnott
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?