Skip to content

feat: support JSON content model pages - #145

Open
lcw861018 wants to merge 1 commit into
Frederisk:masterfrom
lcw861018:feat/json-content-model
Open

feat: support JSON content model pages#145
lcw861018 wants to merge 1 commit into
Frederisk:masterfrom
lcw861018:feat/json-content-model

Conversation

@lcw861018

Copy link
Copy Markdown

Fixes pulling pages whose content model is \json\ (e.g. \MediaWiki:*.json).

Problem

When pulling a page with content model \json, \getPageCode\ mapped it to the \json\ language, but \commentList\ had no \json\ entry, so \getInfoHead\ threw \Unsupported content model: json\ and the page could not be opened.

Change

  • In \modelNameToLanguage, map the \json\ content model to the \jsonc\ language (same highlighting as JSON, and the [PAGE_INFO]\ comment header is valid there), matching the existing handling of \ low-board.
  • Added a unit test covering round-tripping a JSON page header through \getContentInfo.

Verification


  • pm run compile\ passes (only a pre-existing webpack warning).
  • Unit tests pass (4 passing, including the new JSON case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant