Skip to content

Conversation

denisu
Copy link

@denisu denisu commented Jan 1, 2021

Thank you for this module! I have used it to decode millions of old forum posts, it works well, but I have discovered an error with malformed html entities, specifically with &#;.

Example:

htmlEntities.decode('hello world &#;') 

Leads to:

htmlentities.lua:2317: bad argument #1 to 'abs' (number expected, got string) 

To solve this bug, I have changed the matching regex from * to + to match only entities with at least one occurrence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant