Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Special character & #20

Open
EBendinelli opened this issue Mar 4, 2019 · 2 comments
Open

Special character & #20

EBendinelli opened this issue Mar 4, 2019 · 2 comments

Comments

@EBendinelli
Copy link
Contributor

EBendinelli commented Mar 4, 2019

I've noticed the character & is being transformed to & when posted to Mastodon (see here). I guess this comes from how the text scrapped from tweets is considered (HTML instead of text).

Any idea how to fix that?

@yogthos
Copy link
Owner

yogthos commented Mar 4, 2019

Might be getting parsed out as & from the source as well. Can you try adding a formatter here:

(clj->js (merge {:status (-> status-text resolve-urls set-signature)}

You could add a new function that'll do formatting:

(defn format-text [text]
  (string/replace text #"&" "and"))

and then change {:status (-> status-text resolve-urls set-signature)} to {:status (-> status-text resolve-urls format-text set-signature)} to post process the status text it's posted.

@jerger
Copy link
Collaborator

jerger commented Jun 23, 2021

Any merge request in this direction would be very welcome :-)
Pls use our gitlab repo https://gitlab.com/yogthos/mastodon-bot as point of start.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants