Slightly better titles from fediverse topics

An update from last night brings some additional logic to the title generation of topics from the fediverse.

Previously if a title was provided in the name property, that was used as the topic title.

While that hasn't changed (and is the strongest signal for a topic title), not all fediverse content contains titles. Specifically, Mastodon posts do not require or even have a space to put a title in.

For those cases, we fall back to generating one based on the content. We literally grabbed the first 128 characters or so, and added an ellipsis to the end.

While that worked okay as a stopgap, it meant that a lot of topics ended up with really long titles — not ideal.

The new logic tries to grab the first line of text (either the first <p> or line), and from there, the first sentence, using some naive regular expressions.

While still not a proper alternative to... you know... specifying a title, it's better than nothing I suppose!

I wonder if other fediverse softwares implement title generation logic like this...

1 Like