Go to file
Catrope 085a6f0985 (bug 42487) Don't crash the converter for "<span>\n<p>Foo</p></span>"
The converter was misbehaving when handling <p>s inside <span>s. This
can't be expressed in the linmod, but it would try to anyway. <span><p>
would result in too many paragraph closing elements, leading to an
exception in ve.dm.Document complaining about unbalanced input.
<span>\n<p> would result in an exception in the converter itself while
trying to perform whitespace preservation on the newline.

This change makes the converter detect these scenarios and alienate the
offending node. So <span><p>Foo</p></span> converts to a wrapper
paragraph containing an alienInline whose HTML is "<p>Foo</p>" and which
is annotated with a TextStyleSpanAnnotation.

ve.dm.Converter.getDomFromData():
* Change the criteria for alienBlock vs alienInline
** Only infer from the node type if we're in wrapping mode AND we're at
   the same level where the wrapping started (wrappingIsOurs). If the
   latter isn't the case, we can't split the wrapper in the block case
   because we're at the wrong level.
** Use alienInline not only if the branch is a content branch, but also
   if there are active annotations. This catches e.g. <li><b><p>
   (and generally <span><p> on the top level).
* Before converting a child element, check that the child isn't "bad".
  Bad children are non-content children in content branches, and
  non-content children encountered within a wrapper that we can't split.
  Only good children are converted, and bad children are alienated (cue
  Santa/Sinterklaas jokes).
* Add childIsContent and rename branchIsContent to branchHasContent

Change-Id: If420ae80ab0777424a9a5517335ef9d0170e87ae
2012-12-05 17:20:07 -08:00
demos Demos: Fix for I53b041f8 fixing Idbff4c51 fixing I840f7242 2012-12-05 08:18:09 +01:00
maintenance Clean up, fix errors on demos. 2012-12-04 08:58:20 +01:00
modules (bug 42487) Don't crash the converter for "<span>\n<p>Foo</p></span>" 2012-12-05 17:20:07 -08:00
.gitignore Removed Parsoid-related files from .gitignore 2012-08-26 12:20:06 +03: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 inheritClass: Implement inherited 'static' property for classes. 2012-10-09 18:29:41 +00:00
ApiVisualEditor.php (bug 41865) Save page behavior for oldid 2012-12-05 06:44:41 +00:00
AUTHORS.txt Remove the parser from the VE repo 2012-07-30 13:19:09 -07:00
CODING.md ve.ui.CommandFactory: Initial implementation 2012-10-24 17:48:16 +00: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 init.Platform: Refactor parsed messages. 2012-12-04 07:56:41 +01:00
VisualEditor.i18n.php Localisation updates from http://translatewiki.net. 2012-12-05 20:57:33 +00:00
VisualEditor.php Add cancel button to VisualEditor MediaWiki integration. 2012-12-05 15:00:46 -08:00
VisualEditorMessagesModule.php Another fix for I7f26b47e9467e850c08b9c217c4f1098590de109 2012-12-04 11:27:11 -08: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