Skip to content
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

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

Open
rajveermalviya opened this issue Oct 25, 2024 · 0 comments
Open

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

rajveermalviya opened this issue Oct 25, 2024 · 0 comments
Labels
a-content Parsing and rendering Zulip HTML content, notably message contents

Comments

@rajveermalviya
Copy link
Collaborator

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

@gnprice gnprice added the a-content Parsing and rendering Zulip HTML content, notably message contents label Oct 25, 2024
@gnprice gnprice added this to the Post-launch milestone Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-content Parsing and rendering Zulip HTML content, notably message contents
Projects
Status: No status
Development

No branches or pull requests

2 participants