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
Two small follow-ups to #296.
1. Pretty-print the export
downloadJsoncurrently callsJSON.stringify(jsonData)with no indent argument, so the exported file is one long line. Hard to skim or diff. Switch toJSON.stringify(jsonData, null, 2)for two-space indentation.2. Drop the legacy import path
jsonToHtmlfalls back tolegacyJsonToHtmlwhen it sees the old nestedjsonData.article.section.paragraphs[].spans[]shape, andimportJsonfalls back to the top-leveljsonData.url. Anyone holding an old export can re-export from a recent build, so the fallback isn't worth carrying.Remove:
if (jsonData && jsonData.article) { return legacyJsonToHtml(jsonData); }branch injsonToHtml.legacyJsonToHtmlfunction itself.|| jsonData.urlback-compat inimportJson.Acceptance criteria
legacyJsonToHtmlis removed.