Page MenuHomePhabricator

Formatnum outputs extraneous spacing
Closed, ResolvedPublic

Description

From https://www.mediawiki.org/wiki/Help_talk:Magic_words#Formatnum_outputs_extraneous_spacing

manglePreprocessorResponse puts categories on their own line. For example,

> echo "{{formatnum:22,000,000}}" | php bin/parse.php
<p data-parsoid='{"dsr":[0,24,0,0]}'><span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[]],"dsr":[0,24,null,null]}' data-mw='{"parts":[{"template":{"target":{"wt":"formatnum:22,000,000","function":"formatnum"},"params":{},"i":0}}]}'>22,000,000
</span><link rel="mw:PageProp/Category" href="./Category:Pages_with_non-numeric_formatnum_arguments" about="#mwt1" data-parsoid='{"stx":"simple","a":{"href":"./Category:Pages_with_non-numeric_formatnum_arguments"},"sa":{"href":"Category:Pages_with_non-numeric_formatnum_arguments"}}'/></p>

which seems to cause some confusion for visual editors. It also means we need the code in PP/Handles/LiFixups.php

Remind me again why this is so?

Event Timeline

This was introduced in T72196

T260093 looks like it might be a bug in LiFixups

Arlolra triaged this task as Medium priority.
Arlolra moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.

Change 702684 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] [WIP] Stop adding newlines when mangling wikitext

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

It also means we need the code in PP/Handles/LiFixups.php

No, that's more general than this ...

Change 702684 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Stop adding newlines in manglePreprocessorResponse

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

Change 704142 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/vendor@master] Bump parsoid to 0.14.0-a7

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