Page MenuHomePhabricator

Flow comments start and end with a lot of whitespace
Closed, ResolvedPublic


After T175937 was resolved, I was hoping that posts could be extracted with something as simple as

$( 'article' ).map( function( i, e ) {
	return $( e ).text();
} );

When I tried this, I noticed that many Flow posts start with "\n\t\t\t\t\t\t" (a line break and six tabs) and ends with "\n\t\t\t\t\t" (a line break and five tabs). Some posts start with "\n\t\t" and end with "\n\t". There does not seem to be – as far as I'm able to discern – any pattern to this, i.e. it does not seem to be related to indentation of the post.

Is this intentional? Where does it come from?

Example page:


Related Gerrit Patches:
mediawiki/extensions/Flow : masterTrim whitespace around Flow posts

Related Objects

Event Timeline

Nirmos created this task.Mar 4 2018, 4:12 AM
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptMar 4 2018, 4:12 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Nirmos triaged this task as Lowest priority.Mar 4 2018, 4:12 AM

There's a bunch of whitespace in the <article> tags before and after. We can probably remove that.

Nirmos updated the task description. (Show Details)Apr 4 2018, 12:33 AM
Catrope removed Catrope as the assignee of this task.Jul 5 2018, 6:00 PM
Restricted Application added a project: Growth-Team. · View Herald TranscriptSep 2 2018, 10:59 PM

Change 458789 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/extensions/Flow@master] Trim whitespace around Flow posts

Change 458789 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] Trim whitespace around Flow posts

Etonkovidova closed this task as Resolved.EditedSep 14 2018, 10:51 PM
Etonkovidova added a subscriber: Etonkovidova.

Checked the fix in betalabs - e.g.:

Compare with testwiki (wmf.20):