Page MenuHomePhabricator

nowiki tags in comments on JavaScript pages are rendered incorrectly
Open, Needs TriagePublicBUG REPORT

Description

Steps to reproduce

Navigate to a JS page with content like this (minimal example at w:User:Rummskartoffel/nowiki-comment.js, see also https://en.wikipedia.org/api/rest_v1/page/mobile-html/User%3ARummskartoffel%2Fnowiki-comment.js):

// <nowiki>
// foo
// </nowiki>

Expected results

The page should be rendered like this, like it does in the browser:

// <nowiki>
// foo
// </nowiki>

Actual results

The page is rendered like this, different from how it does in the browser:

// // foo //

Environments observed

App version: 2.7.50399-r-2022-04-04
Android OS versions: 9
Device model: Huawei Honor 7x (BND-721)
Device language: German

Event Timeline

Added parsoid since mobileapps output is the same with the parsoid output

Dinoguy1000 renamed this task from nowiki tags in comments on JavaScript pages are are rendered incorrectly to nowiki tags in comments on JavaScript pages are rendered incorrectly.May 24 2022, 11:41 AM

I managed to reproduce this locally. The problem is that parsoid falls back to wikitext for all content models other than javascript.
A quick solution (other than implementing a content handler on parsoid) could be to fallback to MW parser output for the supported content models.

Added parsoid since mobileapps output is the same with the parsoid output

Parsoid responds to this with dummy content now instead of trying to parse javascript as wikitext,
https://en.wikipedia.org/api/rest_v1/page/html/User%3ARummskartoffel%2Fnowiki-comment.js