mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
031b96dd2a
Before, replacement operations that both inserted and removed data at the same time would be treated as removals followed by insertions, so we'd reap the metadata from the affected range and move it to the start of the range. For a pure replacement, this doesn't make any sense. Instead, preserve the first min(insertLength, removeLength) elements in the metadata array, then perform a pure insertion splice or a pure removal splice for the length adjustment. Any metadata reaped in a removal splice is restored at the offset where we started removing, after the preserved portion. These changes make the behavior of metadata reaping saner in general (the previous behavior had the potential to move metadata around if it was near a paragraph opening or closing and you converted the paragraph to a heading), and makes the behavior match up with translateOffset(), which is desirable for MetaList synchronization. Change-Id: If9a1c6a7cf43ead7e3e1e8f6e081b139ca65fa53 |
||
---|---|---|
.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