Last modified: 2014-09-12 21:51:29 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 T72791, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70791 - When inserting new content before headings, insert an extra newline for WT readability
When inserting new content before headings, insert an extra newline for WT re...
Status: ASSIGNED
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Marc Ordinas i Llopis
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-12 21:51 UTC by ssastry
Modified: 2014-09-12 21:51 UTC (History)
2 users (show)

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


Attachments

Description ssastry 2014-09-12 21:51:02 UTC
Heading constraints could use tweaking to make sure that content before existing headings leaves an extra newline for readability even though the heading is not a new heading. We already serialize newly inserted headings correctly. Discovered by looking at serialized output of the [[mw:Parsoid/Deployments]] page.

See shell session below that shows the problem. 
-------------------------
[subbu@earth tests] echo "==A==\na" > /tmp/wt
[subbu@earth tests] node parse < /tmp/wt > /tmp/old.html
[subbu@earth tests] sed 's/<h2>/<h2>NEW<\/h2>\n<p>new<\/p>\n<h2>/g;' < /tmp/old.html > /tmp/new.html
[subbu@earth tests] node parse --html2wt < /tmp/new.html
==A==
a
[subbu@earth tests] sed 's/<h2/<h2>NEW<\/h2>\n<p>new<\/p>\n<h2/g;' < /tmp/old.html > /tmp/new.html
[subbu@earth tests] node parse --html2wt < /tmp/new.html
== NEW ==
new
==A==
a
[subbu@earth tests] node parse --selser --oldhtmlfile /tmp/old.html --oldtextfile /tmp/wt < /tmp/new.html
== NEW ==
new
==A==
a
-------------------------
[subbu@earth tests] echo "<h2>y</h2>\n<p>bar</p>\n<h2>x</h2>\n<p>foo</p>\n<h2>boo</h2>\n<p>bar</p>" | node parse --html2wt
== y ==
bar

== x ==
foo

== boo ==
bar
-------------------------

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


Navigation
Links