Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stork search unicode issue in title #336

Closed
srid opened this issue Aug 17, 2022 · 3 comments
Closed

Stork search unicode issue in title #336

srid opened this issue Aug 17, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@srid
Copy link
Owner

srid commented Aug 17, 2022

From @jilleJr #327 (comment)

Emojis are broken in the search results. The \U000... part.

image

@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.

image

I.e, it seems to be somewhere in the haskell code that's causing this

Originally posted by @jilleJr in #327 (comment)

@srid
Copy link
Owner Author

srid commented Aug 17, 2022

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: kowainik/tomland#334

@srid srid changed the title tomland: Emojis are broken in the search results. The \U000... part. Stork search unicode issue in title Aug 17, 2022
@srid
Copy link
Owner Author

srid commented Aug 18, 2022

Looks to be an upstream bug: kowainik/tomland#408

@srid srid added the bug Something isn't working label Aug 18, 2022
@srid srid mentioned this issue Aug 18, 2022
4 tasks
srid added a commit to applejag/emanote that referenced this issue Aug 19, 2022
@srid
Copy link
Owner Author

srid commented Oct 29, 2022

Closing because of workaround

@srid srid closed this as completed Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant