Page MenuHomePhabricator

Wikifunctions visual preview for wikitext 2017 uses non-Parsoid rendering and so shows wikitext, not result
Open, HighPublic

Description

On testwiki, in User preferences - Editing enable the following settings (those settings are not default on testwiki)

  • "Use the wikitext mode inside the visual editor, instead of a different wikitext editor" This is sometimes called the '2017 wikitext editor'.
  • "Use the new Parsoid wikitext parser: Always (opt-in)

Steps:

  • on any page in Edit source mode insert the following:
[[File:Lilac Flower&Leaves, SC, Vic, 13.10.2007.jpg|thumb|test image]]
{{Date}} - Date template example 
{{#function:Z11022|128}}
  • click on "Publish changes" - the Publish dialog has two buttons for preview - "Review your changes" and "Show preview"

Screen Shot 2025-04-24 at 1.48.00 PM.png (1×1 px, 220 KB)

  • click on "Show preview" - the edits should be rendered to the Read mode. A template and an image are rendered correctly, but the wikifunction is displayed as a wikitext:

Screen Shot 2025-04-24 at 2.15.43 PM.png (1×2 px, 415 KB)

Notes:

  • clicking on "Review your changes" in the Publish dialog will display the function rendered. Both, "Review your changes" in Visual and wikitext modes are correct:
Screen Shot 2025-04-24 at 1.48.27 PM.png (1×2 px, 464 KB)
Screen Shot 2025-04-24 at 1.48.35 PM.png (1×2 px, 165 KB)

Event Timeline

The Console error when an update for an inserted function is viewed:

  • with enabled 2017 in wikitext editor, go to a page where a wikifunction was inserted
    • click on Edit source and make some edits to a wikifunction; click on "Publish changes"
  • in the Publish dialog click on "Review your changes" switch to a visual preview

The visual preview is not loaded (it is stuck) and the Console shows the following error:
Cannot read properties of null (reading 'length') TypeError: Cannot read properties of null (reading 'length')

Screen Shot 2025-04-25 at 3.53.35 PM.png (1×2 px, 224 KB)
Screen Shot 2025-04-25 at 3.54.32 PM.png (1×2 px, 636 KB)
Jdforrester-WMF changed the task status from Open to Stalled.May 7 2025, 3:32 PM

This is almost certainly because you're doing this on testwiki, which isn't supported. Can you confirm that this works on Wikifunctions.org and Dagbani Wikipedia?

This is almost certainly because you're doing this on testwiki, which isn't supported. Can you confirm that this works on Wikifunctions.org and Dagbani Wikipedia?

The issue has been confirmed on dagwiki and on bnwiktionary wmf.2 (sorry, I was sure that I've replied earlier).

  1. The main issue that the preview does not call the function but shows wikitext I can confirm on dag wikipedia

Screenshot 2025-06-12 at 15.39.12.png (1×1 px, 615 KB)

Also on localhost:
{F62303383}

  1. the second thing mentioned about the console error I cannot confirm on dag wikipedia:

Screenshot 2025-06-12 at 15.45.19.png (1×2 px, 584 KB)

Jdforrester-WMF renamed this task from Wikifunctions visual preview for wikitext 2017 is not available to Wikifunctions visual preview for wikitext 2017 uses non-Parsoid rendering and so shows wikitext, not result.Jun 12 2025, 3:47 PM
Jdforrester-WMF changed the task status from Stalled to Open.

Change #1204950 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/VisualEditor@master] [DNM][WIP] ApiVisualEditor: Re-implement the onArticleParserOptions hook

https://gerrit.wikimedia.org/r/1204950