Page MenuHomePhabricator

CX creates span tags with cx-highlight class
Open, MediumPublic


created with

<span class="cx-segment cx-highlight" data-segmentid="78"></span>


Related Gerrit Patches:
mediawiki/extensions/ContentTranslation : masterReally remove empty segment spans
mediawiki/extensions/ContentTranslation : masterImprove the HTML preparation before publishing

Event Timeline

Magioladitis raised the priority of this task from to Needs Triage.
Magioladitis updated the task description. (Show Details)
Magioladitis added a subscriber: Magioladitis.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 1 2015, 7:39 AM
Magioladitis set Security to None.Sep 1 2015, 7:41 AM
Magioladitis added subscribers: Bgwhite, NicoV.
Amire80 renamed this task from CT creates span tags with weird classes to CX creates span tags with cx-highlight class.Sep 2 2015, 8:10 AM
Amire80 triaged this task as Medium priority.
Amire80 moved this task from Needs Triage to CX6 on the ContentTranslation board.Sep 4 2015, 3:16 PM
Amire80 moved this task from CX6 to CX7 on the ContentTranslation board.Oct 1 2015, 5:55 PM
Amire80 moved this task from CX7 to Bugs on the ContentTranslation board.Oct 16 2015, 8:14 AM

OK, the AbuseFilter now works and you can see the results here:

From analyzing some pages that had these unnecessary tags in the last few days, I can see that they tend to appear in the beginning or the end of the paragraph, but I don't know if it happens always.

santhosh claimed this task.Jun 13 2016, 8:47 AM

Change 294030 had a related patch set uploaded (by Santhosh):
Improve the HTML preparation before publishing

Change 294030 merged by jenkins-bot:
Improve the HTML preparation before publishing

cx-segment elements are removed by replacing them with their HTML content:

$section.find( '.cx-segment' ).replaceWith( function () {
    return $( this ).html();
} );

Recently, when I find articles that have the <span class="cx-segment"> after publishing, they usually appear in the ends of the paragraphs and they are empty. Maybe if they are empty, the replaceWith() function doesn't do anything?

Another curiosity, which may or may not be related: If you go to , preview the page and inspect the second paragraph, there will be a <span class="cx-segment" data-segmentid="87"></span> element in the wiki source, but it won't be in the DOM of the previewed content.

Change 296216 had a related patch set uploaded (by Santhosh):
Really remove empty segment spans

Change 296216 merged by jenkins-bot:
Really remove empty segment spans

Arrbee moved this task from QA to Done on the Language-Q4-2016-Sprint 5 board.Jul 5 2016, 7:02 AM
Arrbee closed this task as Resolved.Jul 5 2016, 7:03 AM

I cannot see any new appearances of this in the English Wikipedia during the last week, so this is certainly resolved.

This article is not created using CX(if so, it will have CX related tags, edit summary would be different etc). So there is a chance that the user copied the content from CX editor and pasted in VE another browser tab? A case of T220495: Content copied from Content Translation into Visual Editor exposes internal attributes