mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
04516bb02e
The first run of getDomFromData() would preserve whitespace just fine, but it blanked out the .veInternal.whitespace[1] element in certain cases, contaminating the linear model and making the whitespace data inconsistent. Subsequent runs of getDomFromData() would then refuse to serialize that whitespace because the information about it was inconsistent. In getDomFromData(), we sometimes unset .veInternal.whitespace[1] (i.e. set it to undefined) to prevent double processing. Because we're potentially going to modify .veInternal, don't assign it by reference, but copy the object. Added tests asserting that the linear model is unchanged after calling getDomFromData(), because that function should never modify linear model data. This test failed in 4 cases (all whitespace-related) before I added the copyObject() call. Bug: 43543 Change-Id: Ic4c93510518163894201a693ab50331413715967 |
||
---|---|---|
.docs | ||
demos | ||
maintenance | ||
modules | ||
.gitignore | ||
.gitreview | ||
.jshintignore | ||
.jshintrc | ||
ApiVisualEditor.php | ||
AUTHORS.txt | ||
CODING.md | ||
LICENSE.txt | ||
README.txt | ||
VisualEditor.hooks.php | ||
VisualEditor.i18n.php | ||
VisualEditor.php | ||
VisualEditorMessagesModule.php |
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