Other minor frontend.util cleanups (#5629)

* Resync fixUtf8 w/ upstream
* Fix lastIndexOf desc
* Drop unichar usage, it's a crappier unicodeCodepointToUtf8 ;).
This commit is contained in:
NiLuJe
2019-11-24 00:27:27 +01:00
committed by GitHub
parent 4740ab1fdc
commit d8e0b1759b
7 changed files with 55 additions and 49 deletions

View File

@@ -567,7 +567,7 @@ function ReaderDictionary:cleanSelection(text)
-- with plain ascii quote (for french words like "aujourdhui")
text = text:gsub("\xE2\x80\x99", "'") -- U+2019 (right single quotation mark)
-- Strip punctuation characters around selection
text = util.stripePunctuations(text)
text = util.stripPunctuation(text)
-- Strip some common english grammatical construct
text = text:gsub("'s$", '') -- english possessive
-- Strip some common french grammatical constructs