Page MenuHomePhabricator

ProofreadPageTarget dirty diffing
Closed, ResolvedPublic8 Estimated Story Points

Description

With a null edit on http://en.wikisource.beta.wmflabs.org/wiki/Page:Dictionary_of_National_Biography_volume_51.djvu/358?veaction=edit :

pasted_file (678×864 px, 114 KB)

pasted_file (219×867 px, 22 KB)

I get a different dirty diff with the same code locally:

pasted_file (410×853 px, 84 KB)

Event Timeline

Looking at the HTML:

Before:

<body>
	<meta typeof="mw:Includes/NoInclude" id="mwAQ">
	<div [mw template]></div>
	<div class="pagetext" id="mwAw">
		<span [mw template]></span>
		<p id="mwBQ">
			<br id="mwBg"/>

			<meta typeof="mw:Includes/NoInclude/End" id="mwBw">
			Foo bar baz
		</p>
		<p id="mwCQ">
			Quux
		</p>
		<meta typeof="mw:Includes/NoInclude" id="mwEg">
		<ol class="mw-references" typeof="mw:Extension/references"></ol>
	</div>
	<meta typeof="mw:Includes/NoInclude/End" id="mwFA">
</body>
<body>
	<meta typeof="mw:Includes/NoInclude" id="mwAQ">
	<div [mw template]></div>
	<div class="pagetext" id="mwAw">
		<span [mw template]></span>
		<p id="mwBQ"><br id="mwBg"></p>
	</div>
	<meta typeof="mw:Includes/NoInclude/End" id="mwBw">
	Foo bar baz
	<p id="mwCQ">
		Quux
	</p>
	<meta typeof="mw:Includes/NoInclude" id="mwEg">
	<ol class="mw-references" typeof="mw:Extension/references"></ol>
	<meta typeof="mw:Includes/NoInclude/End" id="mwFA">
</body>

The paragraph gets unwrapped but converting this to wikitext that shouldn't be a problem.

Why is the mw:Includes/NoInclude/End getting moved out of the p though?

Because the <div class="pagetext"> is being confined to the header so sections are balanced, which means closing it when the mwBw noinclude is encountered.

Because the <div class="pagetext"> is being confined to the header so sections are balanced, which means closing it when the mwBw noinclude is encountered.

Sorry, I meant <meta typeof="mw:Includes/NoInclude/End" id="mwBw"> being moved out of <p id="mwBQ"><br id="mwBg"></p> (along with the text node).

So part of the problem is that <div class="pagetext"> is cached by RESTBase, so we'll need to do a big purge now the content model has changed.

The pagetext div was a caching issue, we got it to go away by editing the page. The remaining dirty diff happened because {{RunningHeader}}</noinclude>at a later date.) blah blah blah was all considered one template by Parsoid, and we tried to split in the middle of a templated block. This is now "fixed" because I imported the RunningHeader template (it was previously a red link).

This fixed the dirty diff (see this clean VE edit), but the first paragraph was still considered templated in its entirety. I "fixed" this by removing newlines from the float left template, but this seems to be another Parsoid bug. I'll try to isolate these bugs.

... but the first paragraph was still considered templated in its entirety. I "fixed" this by removing newlines from the float left template, but this seems to be another Parsoid bug. I'll try to isolate these bugs.

See T137942: Template + First paragraph treated like a complex transclusion

Change 297138 had a related patch set uploaded (by Tpt):
Removes <div class="pagetext"> during VisualEditor loading

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

Change 297138 merged by jenkins-bot:
Removes <div class="pagetext"> during VisualEditor loading

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

Tpt claimed this task.