Go to file
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
demos/ve Merge "Add ve.dm.BreakNode to represent <br>" 2012-08-09 21:50:41 +00:00
modules Strip and preserve inner leading&trailing whitespace in the linear model 2012-08-10 17:23:53 -07:00
.gitignore Kranitor #1: On-boarding 2012-07-27 14:40:00 -07:00
.gitreview Set defaultrebase=0 2012-06-20 16:27:40 -07:00
.jshintignore JSHint: Added dotfiles and fixed tons of linting warnings. 2012-07-19 10:01:00 -07:00
.jshintrc Make use of new jshint options 2012-08-10 02:50:30 +02:00
ApiVisualEditor.php Pass a (configurable) interwiki prefix to Parsoid 2012-08-06 16:42:18 -07:00
AUTHORS.txt Remove the parser from the VE repo 2012-07-30 13:19:09 -07:00
LICENSE.txt Changed to use MIT license per agreement with the VisualEditor team 2012-07-19 13:25:45 -07:00
README.txt Remove the parser from the VE repo 2012-07-30 13:19:09 -07:00
VisualEditor.hooks.php Register QUnit tests suites in MediaWiki to run from Special:JavaScriptTest 2012-07-27 17:14:23 -07:00
VisualEditor.i18n.php Localisation updates from http://translatewiki.net. 2012-08-10 19:27:26 +00:00
VisualEditor.php Merge "Add ve.dm.BreakNode to represent <br>" 2012-08-09 21:50:41 +00:00
VisualEditorMessagesModule.php Added ve.init.platform with MediaWiki and stand-alone implementations 2012-07-27 13:39:19 -07:00

VisualEditor provides a visual editor for wiki pages. It is written in
JavaScript and runs in a web browser. 

It uses the Parsoid parser to convert wikitext documents to annotated HTML
which the VisualEditor is able to load, modify and emit back to Parsoid at
which point it is converted back into wikitext.

For more information about these projects, check out the wiki:

	* http://www.mediawiki.org/wiki/VisualEditor
	* http://www.mediawiki.org/wiki/Parsoid