Skip to content

Clarify browser_compat section content handling vs Yari behavior #574

@caugner

Description

@caugner

Context

A content field was added to the Compat struct early on (2024-05-19), allowing browser_compat sections to contain content. However, prose content before a compat marker is intentionally split into a separate section to match Yari's behavior.

The original TODO noted this with "?!" — suggesting it was an observation about Yari's quirky behavior rather than a clear feature request.

Current behavior

In crates/rari-doc/src/html/sections.rs, when prose exists before a compat section, rari splits them into separate sections. A comment in the code says:

We have already something in body. Yari does something weird so we do that too: We push compat section and put prose after that 🤷.

Question

Should this behavior be preserved as-is (matching Yari), documented, or changed?

References

  • crates/rari-doc/src/html/sections.rs (section splitting logic)
  • crates/rari-doc/src/pages/json.rs (Compat struct with content field)
  • crates/rari-doc/src/pages/build.rs (content serialization)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions