mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
63e6702c52
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 |
||
---|---|---|
.. | ||
nodes | ||
ve.dm.BranchNode.test.js | ||
ve.dm.Converter.test.js | ||
ve.dm.Document.test.js | ||
ve.dm.DocumentSynchronizer.test.js | ||
ve.dm.example.js | ||
ve.dm.LeafNode.test.js | ||
ve.dm.Node.test.js | ||
ve.dm.NodeFactory.test.js | ||
ve.dm.Surface.test.js | ||
ve.dm.Transaction.test.js | ||
ve.dm.TransactionProcessor.test.js |