Skip to content

Pretty-print exported Hyperaudio JSON and drop legacy import path #298

@maboa

Description

@maboa

Two small follow-ups to #296.

1. Pretty-print the export

downloadJson currently calls JSON.stringify(jsonData) with no indent argument, so the exported file is one long line. Hard to skim or diff. Switch to JSON.stringify(jsonData, null, 2) for two-space indentation.

2. Drop the legacy import path

jsonToHtml falls back to legacyJsonToHtml when it sees the old nested jsonData.article.section.paragraphs[].spans[] shape, and importJson falls back to the top-level jsonData.url. Anyone holding an old export can re-export from a recent build, so the fallback isn't worth carrying.

Remove:

  • The if (jsonData && jsonData.article) { return legacyJsonToHtml(jsonData); } branch in jsonToHtml.
  • The legacyJsonToHtml function itself.
  • The || jsonData.url back-compat in importJson.

Acceptance criteria

  • Exported JSON file opens with one entry per line (indented, readable).
  • legacyJsonToHtml is removed.
  • Importing an old-format export shows an error or imports as an empty transcript — either is fine, no need for a friendly migration path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions