mdn / mdn/rari

Clarify browser_compat section content handling vs Yari behavior

Open
#574 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
57
Forks
47
Avg merge
1d 11h
Merged PRs (30d)
68

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the section-splitting logic in crates/rari-doc/src/html/sections.rs, then trace the Compat content field through crates/rari-doc/src/pages/json.rs and crates/rari-doc/src/pages/build.rs. Compare the current behavior with the stated Yari behavior. Done means the intended behavior is decided and the relevant implementation or documentation reflects that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.