This was caused by a bug in fixupInsertion that caused it to believe
that inserting something like "a</p><p>b</p><p>c" into the middle of an
empty paragraph was invalid.
This commit fixes the fixupInsertion bug, which fixes the
select-all-cut-paste behavior in Chrome. It's still broken in Firefox
because of selection-related issues, but I'll split that out into a
different bug report.
Change-Id: I767f5d37ec7e511778ae9ca8283ec4b26c728298
* addAttribute and getAttribute do the obvious and simple thing
* addNormalizedAttribute remembers an unnormalized version of an attribute and
supports change detection for the normalized attribute
* getAttributeSource retrieves the original attribute if there was a
normalized version which was not changed, or the current value (potentially
based on the normalized version) otherwise. For use by the
WikitextSerializer.
Change-Id: I72533cf6cfff1ddb88be2501653c7c47d270898c
In preparation for the big extraction of Parsoid out of VisualEditor,
we'll start by moving the tests into the parsoid location.
Change-Id: I4a926ee4aad1490d4f769d44e91af80842b881f0
* Got rid of mergeProperties monkey-patch from core-upgrade.
* Reformatted class defns in mediawiki.parser.defines.js.
* Protected unconditional tokenization of list handler output with an
env.trace check.
* Other minor formatting fixes to respect 80-100 column code width
guideline.
Change-Id: Ida769e0e239b01a813b2d30a65aba60216262a43
* the used RDFa types for links are now identical to those listed in
http://www.mediawiki.org/wiki/Parsoid/RDFa_vocabulary, and are supported for
serialization
* Editors are responsible for adjusting the type when converting between link
types. Adding a caption to an mw:UrlLink for example should convert it into
an mw:ExtLink.
Update: rebased on top of trace patches
Change-Id: Ie1b882e2b3fbad08be94769e1167dccd8dfea65d
* Source-based round-tripping now uses typeof="mw:Placeholder" instead of
data-gen.
* mw:Image is supported for round-tripping, but not yet for modifications as
it is still source-based
Change-Id: Ie5cf4e54de0163168c25c2b5c09380657a15970f
* changes:
Additional work on readable tokenizer debug output
Added 'href' key to anonymous KV wikilink and isbn attribute.
Removed utility functions from mediawiki.parser.environment
Added utility methods to ext.Util.js
Added missing var keyword
In trace mode, wrap transform to output trace info
Output chunk tokens to console only in trace mode
Further refinement of readable pretty-printing of tokens.
More fixes on the way to readable debug/trace output.
Added mergeProperties function to Object.prototype
In RTL interface the drop-down arrow overlaps with the text.
The arrow was positioned explicitly in relation to the left margin, and this
can't work in a flipped RTL environment. I changed the position to "right"
and modified the arrow image a bit.
Some visual tweaks to the arrow may still be needed. Another option can be
to convert the image to SVG or to use a character like ▼.
Change-Id: Ib09a2a20b150de6e8a9531fc0db7dfffe4e95525
The current installation instructions suggest reading ParserService.js
to create localsettings.js. Adding this example file should make
the installation a bit easier - the user will simply have to copy
the example file to the target name and edit it.
Also fixed the line ending in the .gitignore entry for localsettings.js.
Change-Id: Ia4f16ac636cbd3473837f439c699e5e3e9950e9e
* This makes wikilink attrs more similar to ext links.
* Added 'content' key to ISBN links, but couldn't add it to regular
wikilinks yet because of complexity of how they are handled in
the rest of the pipeline. Changing this requires fixing up other
parts down the pipeline -- something for later.
* Fixed up wikilink handler to use named lookup for 'href' and
'tail' rather than positional lookup. Content lookup is still
positional as before.
Change-Id: I657b1f338d38df3cfdfa99f27ac46e7fe1c9fd65
* these functions have already been added to ext.Util.js
* removed a couple jshint warnings.
* minor code restructuring in tokensToString and comments
to better indicate what is going on.
Change-Id: I9d6a03cc35075e1a64d8fac9e167a3ce4ccd9424
* Copied over utility methods from mediawiki.parser.environment.js
to ext.Util.js.
* Moved over utility method from mediawiki.parser.defines.js to
ext.Util.js.
* Converted Util to be a singleton object rather than an allocatable
class. There is no reason to allocate a new utility class everywhere
since this utility object has no useful state.
* Fixed up use of utility methods to use Util rather than env.
Change-Id: Ib81f96b894f6528f2ccbe36e1fd4c3d50cd1f6b7