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
Titles are not generated correctly when posting from Mastodon #2686
Comments
Interestingly, this other post handles title generation much better: https://lemmy.ml/post/741382 . Still has some unintentional html tags visible, but closer to what we want. |
That specific post looks like it works only because it hit the character number limit before the text reached the end of the paragraph tag (</p>). I think that the lines() call here is expecting lines to be split by \n instead of having the syntax <p>...</p>. I am not familiar enough with the syntax in rust, but with python I would parse by splitting </p>, and then set name to the first entry from the fourth character onward. |
I can confirm that the following modified syntax in post.rs will produce a post with the correct title:
Here is an example post: I did not submit a PR because I suspect that there is a better way to slice the string than calling remove(0) three times. Also, this change might break from_apub() function calls while fetching posts from other projects, if it is used. EDIT: This does break other federated titles. I am experimenting with EDIT2: This second approach does work (https://mander.xyz/post/525174) and does not appear to break anything. I think it is reasonable, so I will submit a PR. |
Also from Friendica: |
It would be great to strip the actors like the forum name from the title As an aside, this one also includes a content warning. Lemmy ignores the CW text but interprets it as NSFW (which I guess is technically correct, but misses the point of mastodon's albeit shoehorned subject/title field) But that's probably another can of worms |
The forum ping can come anywhere, so putting it at the end of a longer post
makes it not visible in the title.
CW should be appended to the beginning of the body Content Warning:[text]),
but this should be a separate issue/suggestion
…On Sat, Mar 4, 2023, 6:05 PM Django ***@***.***> wrote:
It would be great to strip the forum name from the title (and others I
guess)
https://lemmy.ml/post/787329
This one also includes a content warning.
Lemmy ignores the CW text but interprets it as NSFW (which I guess is
technically correct, but misses the point of mastodon's albeit shoehorned
subject/title field)
—
Reply to this email directly, view it on GitHub
<#2686 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4KBOZSJ77QYJ62N2RJC6UDW2PKFLANCNFSM6AAAAAAUN4R5XM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@Nutomic just realized the issue is closed. I can create a new issue; does this go in lemmy or lemmy-ui? |
@mediaformat You can open a new issue in this repo. |
Found a bug? Please fill out the sections below. 👍
For front end issues, use lemmy-ui
If you have problems installing Lemmy, you should post in !lemmy_support.
Issue Summary
When making a post from Mastodon, titles are not generated correctly.
Steps to Reproduce
Technical details
The text was updated successfully, but these errors were encountered: