Skip to content

Handle legacy code blocks without <code>…</code> #1025

Open
@rajveermalviya

Description

@rajveermalviya

The current codehilite HTML wraps text or syntax-highlighted span elements inside <code>…</code> tags. However, older messages (the latest example found from April 2020 on CZO, so any message before then) don’t include this <code>…</code> wrapper, which is currently expected:

final grandchild = child.nodes.last;
if (grandchild is! dom.Element) return null;
if (grandchild.localName != 'code') return null;

Related discussion:
https://chat.zulip.org/#narrow/channel/243-mobile-team/topic/older.20codehilite.20blocks.3B.20html.20without.20.3Ccode.3E.3C.2Fcode.3E/near/1968837

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-contentParsing and rendering Zulip HTML content, notably message contents

    Type

    No type

    Projects

    • Status

      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions