Page MenuHomePhabricator

Unable to search for the string " :" in the VisualEditor search and replace bar
Open, Needs TriagePublic

Description

To reproduce:

Expected: Find 23 appearances of this.

Observed: The < and > buttons are grayed out, as if the string doesn't appear in the article at all.

Event Timeline

JTannerWMF added subscribers: matmarex, JTannerWMF.

At this time the Editing team can't prioritize this task. However, @matmarex can provide some insight into this particular challenge.

The space is not represented as a real space in our data model, and that's why you can't find it. This is somewhat similar to T151671: Find and replace should be able to operate on multiple lines in NWE (where line breaks are also not represented as real line breaks).

It has to be this way because of a special case in MediaWiki's parser. Spaces before colons (and some other characters) become non-breaking spaces (this behavior is known as "French spaces"). However, Parsoid can't simply do the same, because if it did, then converting Parsoid's HTML back to wikitext would result in the space being replaced by &nbsp; in the wikitext. Therefore it has to add some special markup, and we have to preserve that markup in VisualEditor as well. It's unfortunately not easy to make this work intuitively with find-and-replace.

The space is not represented as a real space in our data model, and that's why you can't find it. This is somewhat similar to T151671: Find and replace should be able to operate on multiple lines in NWE (where line breaks are also not represented as real line breaks).

It has to be this way because of a special case in MediaWiki's parser. Spaces before colons (and some other characters) become non-breaking spaces (this behavior is known as "French spaces"). However, Parsoid can't simply do the same, because if it did, then converting Parsoid's HTML back to wikitext would result in the space being replaced by &nbsp; in the wikitext. Therefore it has to add some special markup, and we have to preserve that markup in VisualEditor as well. It's unfortunately not easy to make this work intuitively with find-and-replace.

Thanks for the explanation. I hope it can be fixed Some Day™.