Last modified: 2014-03-10 18:21:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64498, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62498 - Selser: More robust handling of text-nodes outside p-tags
Selser: More robust handling of text-nodes outside p-tags
Status: NEW
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Low enhancement
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-10 17:50 UTC by ssastry
Modified: 2014-03-10 18:21 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description ssastry 2014-03-10 17:50:55 UTC
See seler bug below when a text node is inserted outside a <p> tag.
--------------------
[subbu@earth tests] echo "foo\n\nbar" > /tmp/wt
[subbu@earth tests] node parse < /tmp/wt > /tmp/old.html
[subbu@earth tests] cp /tmp/old.html /tmp/new.html
[subbu@earth tests] vi /tmp/new.html
[subbu@earth tests] cat /tmp/new.html
<body data-parsoid='{"dsr":[0,9,0,0]}'><p data-parsoid='{"dsr":[0,3,0,0]}'>foo</p>NEW<p data-parsoid='{"dsr":[5,8,0,0]}'>bar</p>
</body>
[subbu@earth tests] node parse --html2wt --selser --oldtextfile /tmp/t --oldhtmlfile /tmp/old.html < /tmp/new.html
fooNEW
bar
[subbu@earth tests] node parse --html2wt < /tmp/new.html
fooNEW

bar
--------------------
Comment 1 C. Scott Ananian 2014-03-10 17:52:04 UTC
There are a number of image-related selser failures due to this bug.
Comment 2 ssastry 2014-03-10 17:53:55 UTC
(In reply to ssastry from comment #0)
> See seler bug below when a text node is inserted outside a <p> tag.

*selser

> [subbu@earth tests] node parse --html2wt --selser --oldtextfile /tmp/t
> --oldhtmlfile /tmp/old.html < /tmp/new.html

*/tmp/wt
Comment 3 Gabriel Wicke 2014-03-10 18:00:53 UTC
I don't see how we can generally serialize this kind of HTML so that it round-trips html2html.
Comment 4 ssastry 2014-03-10 18:09:47 UTC
Yes, we cannot make this survive html2html. 

For now, I am marking this an enhancement for addressing in the context of the class of bugs we have for accepting arbitrary html. Meanwhile, I'll fix up parserTests.js to eliminate these kinds of (simulated) edits.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links