Skip to content

MSC4313: Require HTML <ol> start Attribute support #4313

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

HarHarLinks
Copy link
Contributor

@turt2live turt2live added proposal A matrix spec change proposal client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Jul 15, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation requirements:

  • Client (ideally several)

Copy link
Contributor Author

@HarHarLinks HarHarLinks Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I know this is already implemented in Element-Web, Fractal, FluffyChat 2.0. There are likely more. What do you need as confirmation?

  • Implementations meeting this proposal but with limited issues (such as not rendering the number when the item has no content) exist, e.g. Nheko 0.12.0-9571d811, NeoChat, Element/SchildiChat classic, FluffyChat 1.25.

  • A counter-example would be Element X, at least on Android.

Bob replies:
2.

Let's assume Bob's client takes the option to translate the plain text `2.` to HTML.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arguably this is the bug, not the lack of start

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(also, why aren't they using polls?)

Copy link
Contributor Author

@HarHarLinks HarHarLinks Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec says I may use start in my HTML body. If I use it and my conversational partner cannot interpret it correctly, then the spec does not adequately prevent communication from breaking there. How we get into this situation is irrelevant imo, unless we want to start speccing how the formatted_body must be constructed, which I hope is widely out of scope of Matrix.

(Whether to use polls or not is also not the question.)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err, all that you need to do to invoke this issue is typing in EXA that you like the
4. of July.

which could mean that fewer clients could choose to implement `ol` at all.


## Alternatives
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you prevent the sending client from turning 2. into an <ol> in the first place?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent of where this MSC goes I feel like this ("better logic for when to convert X. (numbers) into <ol>) is an issue report that should be opened against clients that currently do not do that in a sane way ?
I even remember seeing such issues iirc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I change my example, because apparently many reviewers are missing the issue I am trying to point out for another issue.

It is currently legal and intended within the Matrix spec for Alice to type:

3. A
4. B
5. C

and Alice's client to send this as "formatted_body": "<ol start=\"3\"><li>A</li><li>B</li><li>C</li>".

The above is a legal message, and there are valid use cases to get there. This formatted_body legally existing is the basis for this MSC. It is not concerned with how to get there, as long as you are allowed to get there.

Then the issue is that Bob's client missing support for start might render it as

1. A
2. B
3. C

What I at this point regard as out of scope of this MSC (convince me otherwise?) is prescribing to clients how to and how not to generate their HTML. Possible ways for clients to construct formatted_bodys could be:

  • interpret "plain text" as some markdown dialect (yes this is inconsistent across different clients), as most clients do today
  • users enter custom HTML straight in the input box, e.g. using Element Web's /html command
  • parse Org mode
  • a bot doing STT and heuristically applying formatting
  • any custom input language
  • AI generating formatted_body from a user signing sign language into their webcam
  • anything you can think of

So to get rid of erratic behavior, the spec could try to come up with rules trying to cover a million edge and corner cases that prevent a simple answer of 2. (current MSC example) or 4. of July (from spaetz) from being converted to an ol. But still the problem is not solved, see example above.

An easy alternative would be to disallow start from the spec, i.e. only allow ordered lists starting at 1, and leaving it up to clients to not mistakenly convert numbered lists starting not at 1 (incl misinterpretations like 4. of July) to ols.

Can anyone find a reference as to when start support was added to the spec, ideally the MSC and reasoning for it?

Copy link
Contributor

@Johennes Johennes Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think fixing the start issue as per this proposal definitely makes sense in any case.

I was just thinking that when I type "4. Juli", I actually wouldn't want it to become an ordered list starting at 4. Even if it's displayed similarly, semantically it's something very different from what I intended. Agree that this is a different problem though and should be solved in another proposal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking that when I type "4. Juli", I actually wouldn't want it to become an ordered list starting at 4. Even if it's displayed similarly, semantically it's something very different from what I intended. Agree that this is a different problem though and should be solved in another proposal.

To be clear, I agree that this is annoying and suboptimal, and clients should do better. I am not sure though if this even falls into the area of concern of the spec.

Comment on lines +44 to +45
Bob said:
1.
Copy link
Contributor Author

@HarHarLinks HarHarLinks Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For evidence, this is the case in Element X as of 25.07.0.

Further evidence: nheko 0.12.0-9571d811 and SchildiChat ("classic") will show only whitespace here.

Signed-off-by: HarHarLinks <2803622+HarHarLinks@users.noreply.github.com>
@HarHarLinks HarHarLinks force-pushed the require-ol-start-attribute branch from cd1d152 to 7e4dca4 Compare July 16, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants