Open Bug 1140967 Opened 10 years ago Updated 12 days ago

Detect <code> blocks and add syntax highlighting, line numbers, etc

Categories

(Toolkit :: Reader Mode, enhancement, P5)

enhancement

Tracking

()

People

(Reporter: Unfocused, Unassigned)

References

Details

(Whiteboard: [about-reader-ui])

I think we could do a lot with making a consistent and readable experience with <code> blocks in articles. This would tie in nicely with the built-in devtools. Things like: * syntax highlighting * line numbers * etc Potentially we could go a step further by adding richer interactive features: * open in something like CodePen * fork on Github * copy entire block But it's less clear those fit in with the core intent of readability. Maybe something to look to for devtools to optionally provide, and make sure the APIs are there for it?
Priority: -- → P5
See Also: → 1199651
See Also: → 1218232
Whiteboard: [about-reader-ui]
I think this is actually important because the current styling makes code-related articles near-unreadable in reader mode. Maybe it would be enough to do something similar to what is done with hiding things: Preserve common classes and add default styling for them. For example, any class starting with ``hljs-`` could be preserved.
Severity: normal → --
Type: defect → enhancement

(In reply to Mike from comment #4)

regression from this one?
https://bugzilla.mozilla.org/show_bug.cgi?id=1218232

No, this bug is older than 1218232 so it logically can't be. And anyway this ticket is a feature request.

You need to log in before you can comment on or make changes to this bug.