glitch-soc / mastodon

A glitchy but lovable microblogging server
https://glitch-soc.github.io/docs/
GNU Affero General Public License v3.0
682 stars 181 forks source link

Markdown parser does not allow ordered lists to start on other than 1. #2574

Open nztvar opened 5 months ago

nztvar commented 5 months ago

Steps to reproduce the problem

  1. Enter a (continued) list in a toot.
4. fourth list item
5. fifth list item
  1. Toot.

Expected behaviour

generated ol tag should include 'start="4"'

Actual behaviour

generated ol tag has no start attribute

Detailed description

Not sure which markdown processor is in use; I am aware some flavours do not support start attributes. But, for a threaded microblog, ordered lists will be abused in exactly the way I was trying to do - a list with more items than will comfortably fit in a single toot, so broken across multiple threaded toots.

Mastodon instance

mstdn.ca

Mastodon version

v4.3.0-alpha.0+glitch

Browser name and version

121.0 (64-bit)

Operating system

Fedora 39

Technical details

No response

joyeusenoelle commented 5 months ago

This is not a bug; glitch-soc is properly rendering the Markdown you've entered. Vanilla Markdown doesn't support starting an ordered list with a number other than 1, and glitch-soc's rendering engine, Redcarpet, renders vanilla Markdown by default.

It's probably possible to write a Redcarpet extension to implement a start attribute (perhaps prepending the list with {start: 4} as Kramdown does), but it would be up to you to start your lists in the second post with the modifier declaration.

The other option, of course, is to change the content type and write your second post in HTML; <ol start=4> should work just fine.