mediawiki-extensions-Visual.../modules/ve/dm
Catrope 63e6702c52 Strip and preserve inner leading&trailing whitespace in the linear model
This makes things like
== Foo ==
* Bar
render without the leading and trailing spaces, while still
round-tripping those spaces.

* Added a .fringeWhitespace property to the linear model and ve.dm.Node
** Object containing innerPre, innerPost, outerPre, outerPost
** Only inner* are used right now, outer* are planned for future use
** Like .attributes , it's suppressed if it's an empty object
* In getDataFromDom():
** Store the stripped whitespace in .fringeWhitespace
** Move emptiness check up: empty elements with .fringeWhitespace have
   to be preserved
** Move paragraph wrapping up: .fringeWhitespace has to be applied to
   the generated paragraph, not its parent
** Add wrapperElement to keep track of the element .fringeWhitespace has
   to be added to; this is either dataElement or the generated paragraph
   or nothing, but we can't modify dataElement because it's used later
* In getDomFromData():
** When processing an opening, store the fringeWhitespace data in the
   generated DOM node
** When processing a closing, add the stored whitespace back in
* In the ve.dm.Document constructor, pass through .fringeWhitespace from
  the linear model data to the generated nodes

Tests:
* Change one existing test case to account for this change
* Add three new test cases for this behavior
* Add normalizedHtml field so I can test behavior with bare content

Change-Id: I0411544652dd72b923c831c495d69ee4322a2c14
2012-08-10 17:23:53 -07:00
..
annotations Clean up a few commas and some indentation 2012-08-10 16:49:14 -07:00
nodes Add ve.dm.BreakNode to represent <br> 2012-08-09 14:50:25 -07:00
ve.dm.Annotation.js Puttin' em white-spacers where they aught'a be 2012-08-06 18:52:19 -07:00
ve.dm.AnnotationFactory.js Puttin' em white-spacers where they aught'a be 2012-08-06 18:52:19 -07:00
ve.dm.BranchNode.js Make use of new jshint options 2012-08-10 02:50:30 +02:00
ve.dm.Converter.js Strip and preserve inner leading&trailing whitespace in the linear model 2012-08-10 17:23:53 -07:00
ve.dm.Document.js Strip and preserve inner leading&trailing whitespace in the linear model 2012-08-10 17:23:53 -07:00
ve.dm.DocumentSynchronizer.js Clean up a few commas and some indentation 2012-08-10 16:49:14 -07:00
ve.dm.js Removed some whitespace 2012-07-19 14:25:16 -07:00
ve.dm.LeafNode.js Puttin' em white-spacers where they aught'a be 2012-08-06 18:52:19 -07:00
ve.dm.Node.js Strip and preserve inner leading&trailing whitespace in the linear model 2012-08-10 17:23:53 -07:00
ve.dm.NodeFactory.js After much research on error objects, native = good, custom = bad 2012-08-08 10:48:53 -07:00
ve.dm.Surface.js Added isNoOp to ve.dm.Transaction 2012-08-10 15:35:48 -07:00
ve.dm.SurfaceFragment.js Added basic ve.dm.SurfaceFragment class 2012-08-09 16:18:13 -07:00
ve.dm.Transaction.js Added isNoOp to ve.dm.Transaction 2012-08-10 15:35:48 -07:00
ve.dm.TransactionProcessor.js Clean up a few commas and some indentation 2012-08-10 16:49:14 -07:00