sync: dev to extern-contrib

Merged
GI
2mo ago
+675-46

sync-branches: New code has just landed in dev, so let's bring extern-contrib up to speed!

Summary by Sourcery

Improve problem-statement Markdown copying while preserving source formatting and add comprehensive browser regression coverage.

New Features:

  • Add Markdown copy controls for complete problems and individual sections, including structured sample input/output blocks.
  • Preserve TeX math, code fences, tables, links, images, and other formatting when copying problem statements as Markdown.

Bug Fixes:

  • Prevent rendered math and structured content from being flattened or duplicated during Markdown copying.

Enhancements:

  • Refactor problem Markdown copy generation to support modern and classic page layouts and follow the currently displayed language.

CI:

  • Install dependencies and Chromium in CI before running the browser-based test suite.

Tests:

  • Add Playwright regression coverage for Markdown formatting, math, tables, samples, language selection, copy controls, and extraction failures.

Chores:

  • Bump the userscript and package version to 3.8.0 and record the release in Update.json.

Summary by cubic

Syncs dev into extern-contrib, bringing the 3.8.0 release: it restores the userscript on pages broken by recent layout changes, makes copy controls work on the new /web/contest pages, and adds problem Markdown copying that preserves TeX math source, code fence language, table layout, and link destinations.

  • Fixes a TypeError on abnormal pages and reuses the copy controls across the new and legacy contest pages.
  • Adds copy controls for each section, the samples, and the full problem statement, with rendered math replaced by its TeX source and sample data copied as fenced blocks under their original headings.
  • Adds a Playwright browser test suite for Markdown copy regressions and makes CI install Chromium before running tests.
  • Bumps the userscript to 3.8.0 (with 3.7.2 as a prerelease) and adds the matching release entry to Update.json.