116
submitted 6 months ago* (last edited 6 months ago) by amon@lemmy.world to c/fediverse@lemmy.world

EDIT: on web, it renders like this

all 49 comments
sorted by: hot top controversial new old
[-] andrew_s@piefed.social 39 points 6 months ago

You can, but maybe you shouldn't. Given that this post is in the fediverse community, I don't feel too bad about mentioning that Lemmy is part of a federated network with PieFed and MBIN (I try not to bollock on too much about the platform I happen to be using).

In the ActivityPub JSON for this post, there is no indication that this field contains MarkDown. If anything, it says the opposite, it says it contains HTML. It's therefore not unreasonable for other platforms to render it as such.

Given this, and the poor support for mobile clients indicated in the comments, and the fact that it's only a subset of MarkDown tags, but include ones that aren't part of CommonMark standard, I'd argue that it's not necessarily a good idea.

[-] flamingos@feddit.uk 16 points 6 months ago

In the ActivityPub JSON for this post, there is no indication that this field contains MarkDown. If anything, it says the opposite, it says it contains HTML. It’s therefore not unreasonable for other platforms to render it as such.

Actually, the name property is explicitly plain text, it shouldn't contain any type of markup, whether that be markdown or HTML.

[-] andrew_s@piefed.social 4 points 6 months ago

Oh, wow. Thanks.

For clarity, I wasn't intending to say that PieFed treats that field as HTML (it treats it as text), I just meant that if you were looking at that JSON, and being a bit lazy like me and not looking at specs, then it wouldn't be unreasonable to assume that the 'mediaType' field also refers to 'name' (rather than a 'content' field which this post doesn't happen to have).

Anyway, this seems to be even more reason why MD shouldn't be put in titles, and front-ends shouldn't be encouraging the practise by rendering it.

[-] kat@orbi.camp 2 points 6 months ago

Eh, I'll probably use italics tho, just like I did * in reddit.

[-] AA5B@lemmy.world 3 points 6 months ago

In the ActivityPub JSON for this post, there is no indication that this field contains MarkDown. …. it says it contains HTML

This seems like a bug. Regardless of what clients may support, the json ought to accurately describe fields

[-] andrew_s@piefed.social 8 points 6 months ago

Another commenter (who's contributed code to Lemmy) pointed to a link that provides the specification for that field: "A simple, human-readable, plain-text name for the object. HTML markup MUST NOT be included."

So in this case, it's more that the JSON looks a bit ambiguous: 'mediaType' is only referring to the format of the text in a post's body, but - unlike me - you'd also need to be aware of the spec to know that it doesn't apply to the title.

[-] p03locke@lemmy.dbzer0.com 3 points 6 months ago

Also, this gives me real text-on-image-in-Facebook-post-just-to-get-noticed vibes.

If everybody can use Markdown in their post titles, then everybody will use Markdown in their post titles, until it's a mess of colors, bold, and italics.

[-] nutomic@lemmy.ml 2 points 6 months ago

The Lemmy backend doesnt treat this field as markdown, if you look at the Activitypub data (curl -H "Accept: application/activity+json" https://lemmy.world/post/24241974 | jq) the title is federated as plaintext. Only lemmy-ui decides to render it as markdown for some reason.

[-] schnurrito@discuss.tchncs.de 1 points 6 months ago

Do you know a way to see the ActivityPub JSON for fediverse objects?

[-] BentiGorlich@gehirneimer.de 7 points 6 months ago

you can use https://browser.pub I like it very much for that use case :)

[-] andrew_s@piefed.social 5 points 6 months ago

Yes - it's easy to do from a command line. For this post, it would be:

curl --header 'accept: application/activity+json' --location https://lemmy.world/post/24241974 | jq .

it looks like

{  
  "@context": [  
    "https://join-lemmy.org/context.json",  
    "https://www.w3.org/ns/activitystreams"  
  ],  
  "type": "Page",  
  "id": "https://lemmy.world/post/24241974",  
  "attributedTo": "https://lemmy.world/u/amon",  
  "to": [  
    "https://lemmy.world/c/fediverse",  
    "https://www.w3.org/ns/activitystreams#Public"  
  ],  
  "name": "By the way, you can have `Markdown` in Lemmy post titles",  
  "cc": [],  
  "mediaType": "text/html",  
  "attachment": [],  
  "commentsEnabled": true,  
  "sensitive": false,  
  "published": "2025-01-13T20:48:50.824942Z",  
  "language": {  
    "identifier": "en",  
    "name": "English"  
  },  
  "audience": "https://lemmy.world/c/fediverse"  
}   

[-] schnurrito@discuss.tchncs.de 1 points 6 months ago

Thanks, will try that out

[-] driving_crooner@lemmy.eco.br 17 points 6 months ago

If you have markdown on your title, then is not being rendered by Jerboa.

[-] f4f4f4f4f4f4f4f4@sopuli.xyz 3 points 6 months ago

Do you also have the Android weirdness in which the tick marks appear to be in a different place? (Not Jerboa-specific)

[-] driving_crooner@lemmy.eco.br 1 points 6 months ago

The tick marks appear correctly for me.

[-] kat@orbi.camp 1 points 6 months ago

Sync for lemmy works

[-] vk6flab@lemmy.radio 16 points 6 months ago

Word of caution, it doesn't render on Connect for Lemmy.

[-] amon@lemmy.world 7 points 6 months ago

Hmm, but the best part about markdown is that it is human readable regardless so it should still be fine

[-] rickyrigatoni@lemm.ee 6 points 6 months ago

i am not human

[-] catloaf@lemm.ee 5 points 6 months ago* (last edited 6 months ago)

Nor Boost. It does in Raccoon, though.

[-] IronKrill@lemmy.ca 3 points 6 months ago
[-] kat@orbi.camp 1 points 6 months ago

Renders fine in Sync

[-] lemmyng@lemmy.ca 1 points 6 months ago

Renders in Summit, but I turned that off because any post title starting with # is rendered as h1.

[-] AmidFuror@fedia.io 9 points 6 months ago

I'd settle for good spelling and grammar. Once most posters have mastered that, let them play with the formatting.

[-] bdonvr@thelemmy.club 9 points 6 months ago

You can also edit them after the fact unlike other platforms

[-] misk@sopuli.xyz 8 points 6 months ago

What good is it for if I can’t change post title font to Comic Sans.

[-] motor_spirit@lemmy.world 4 points 6 months ago
[-] rickyrigatoni@lemm.ee 3 points 6 months ago

Good god, ya'll.

[-] JohnnyEnzyme@lemm.ee 7 points 6 months ago

(unlike Reddit, for example)

I use bold and italic a lot in post titles. Some of the other stuff wouldn't make much sense I don't think, but every little bit helps.

[-] amon@lemmy.world 8 points 6 months ago* (last edited 6 months ago)

I mean, code could work and maybe ^superscript^ or ~subscript~ and that's about it I think

[-] infeeeee@lemm.ee 6 points 6 months ago

Can you create headings in headings?

[-] smeg@feddit.uk 6 points 6 months ago

You can, and it'll probably get annoying if everyone catches on!

[-] infeeeee@lemm.ee 6 points 6 months ago

OK, I will never use it again.

[-] smeg@feddit.uk 3 points 6 months ago
[-] smeg@feddit.uk 2 points 6 months ago

Are sub and superscript officially supported by markdown now? Or is that a Lemmy-specific extension?

[-] infeeeee@lemm.ee 3 points 6 months ago

Lemmy-ui uses markdown-it: https://github.com/LemmyNet/lemmy-ui/blob/main/package.json#L65

Markdown-it follows the CommonMark spec with extensions: https://spec.commonmark.org/current/ As I see superscript is not part of the spec, but listed in the markdown-it readme as a plugin, so I guess it's coming from there: https://github.com/markdown-it/markdown-it?tab=readme-ov-file#syntax-extensions

They are also listed in package.json:

    "markdown-it-sub": "^2.0.0",
    "markdown-it-sup": "^2.0.0",

https://github.com/LemmyNet/lemmy-ui/blob/main/package.json#L73

Lemmy docs about markdown support: https://join-lemmy.org/docs/users/02-media.html#text

[-] Pamasich@kbin.earth 1 points 6 months ago

I think it's fine to use unique platform features like this, but if you're actually using this actively, be aware that not everyone will see your titles as you intended them. It's only Lemmy users that can see it actually render "properly", everyone else just sees the plaintext Markdown symbols.

[-] Fitik@fedia.io 5 points 6 months ago

@amon@lemmy.world Doesn't render it on Mbin

[-] jagged_circle@feddit.nl 5 points 6 months ago
[-] targetx@programming.dev 9 points 6 months ago

Guess it depends on your client because it works for me.

[-] amon@lemmy.world 1 points 6 months ago
[-] jagged_circle@feddit.nl 1 points 6 months ago

Jerboa. Its awful but there's nothing better

[-] perviouslyiner@lemmy.world 3 points 6 months ago

Be careful of the character limit on each viewer, as they can "trim" your title in the middle of some markup tag and just display part of it as the title.

[-] Feathercrown@lemmy.world 1 points 6 months ago
this post was submitted on 13 Jan 2025
116 points (96.8% liked)

Fediverse

35516 readers
83 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, KBin, etc).

If you wanted to get help with moderating your own community then head over to !moderators@lemmy.world!

Rules

Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration)

founded 2 years ago
MODERATORS