emanote
emanote copied to clipboard
Stork search unicode issue in title
From @jilleJr https://github.com/EmaApps/emanote/pull/327#issuecomment-1214423019
Emojis are broken in the search results. The
\U000...
part.
@srid I found the cause. I made Emanote write the TOML file it pipes to stork to a file, and in it we find:
[[input.files]]
path = "./docs/demo/markdown.md"
title = "Extended Markdown \\U0000270d\\U0000fe0f"
url = "demo/markdown.html"
It's escaping the unicode-syntax. It should only be 1 backslash there.
I.e, it seems to be somewhere in the haskell code that's causing this
Originally posted by @jilleJr in https://github.com/EmaApps/emanote/issues/327#issuecomment-1214423019
Reproducible in bin/repl
:
ghci> import qualified Toml
ghci> putTextLn $ Toml.encode (Toml.text "k") "✍️"
k = "\\U0000270d\\U0000fe0f"
ghci>
Notice that it double-escapes the unicode letters.
Using T.replace "\\\\" "\\" . Toml.encode
(not a proper fix), the original bug vanishes - which confirms that the problem is with the double-escaping.
Possibly related: https://github.com/kowainik/tomland/issues/334
Looks to be an upstream bug: https://github.com/kowainik/tomland/issues/408
Closing because of workaround