Overriding ve.ce.BranchNode#onSplice seems pretty scary, some bug
could cause two captions to be inserted and it wouldn't even be
visible in the editor.
Instead, allow normal splice handling to happen when the caption is
added/removed, and only override the position where it is inserted
(to account for the image node this.$a).
The caption node is already removed from DM/CE if the image type is
changed to one that doesn't have captions, and even if that failed it
is also hidden in CSS, so we don't need to handle this.
Change-Id: I54f52b288118d692708311512dd674cc85d5d9e3
5f6664e2 in VE core changed the specificity for some of the rules this
expected to override.
Bug: T189267
Change-Id: I510e151cc431c321d1d45fde9030d56f059d84ab
After change 89aecd54ba (2014),
there is no 'border' value for the 'type' attribute, instead
there is a 'borderImage' attribute only present when 'type'
is 'none' or 'frameless'.
Change-Id: Id87ba09b647f5f69b1c9350209e66acdea2c9d69
MWBlockImageNode already can't have any slugs:
* It can't have inline slugs, because it can't directly contain
content (`this.canHaveChildrenNotContent()` is true)
* It can't have block slugs, because it can't contain paragraphs
(`this.isAllowedChildNodeType( 'paragraph' )` is false).
(The only thing it can contain is a mwImageCaption.)
Change-Id: Ice6505da2356f004ef048ed0b1a9e03d08af02d1
For galleries with 0 items, this would previously return an empty
jQuery collection, which caused funny rendering issues later.
Bug: T75230
Change-Id: Ia68e4f1b74b5ec494fa3d86f0b792f69eadb02fb
We emit <span id="..." typeof="mw:FallbackId"></span> inside headings
when necessary to provide backward compatibility with pre-HTML5
section ids. These are mostly harmless inside VE --- they become hidden
alienated nodes, which are then safely ignored by Parsoid during html2wt
even if they manage to migrate outside of a heading --- but it's a
little safer to strip them.
Change-Id: I07d0fcf54427ab02d4930cff183d3e5579a99306
* Look inside first child for autoGenerated (as reflists can be wrapped)
* Unwrap Parsoid sections
* Discard leading and trailing whitespace
Bug: T179618
Change-Id: Ib9ead28173360f0f1d5a4dc66c33a75d70ef34b3
Override ve.ce.FocusableNode#hasRendering with a model-based test to
improve efficiency and avoid some unnecessary DOM measurements.
Change-Id: Ice7aebcc2f30dc73ef049a6ed0d4a0cffe86d8e2
Also:
* Disconnect change event on this.input, which doesn't
get destroyed on teardown
* Add padding between attributes and this.input
* Assume the alien extensions can have a rendering when
their body is empty.
Bug: T177181
Bug: T177183
Change-Id: I2e59f8195b255f33f91901213c92ea14793635b4
The default value of target#pageName is wgRelevantPageName
but other targets my override this, or change it dynamically
(e.g. ContentTranslation).
Also remove duplicate setter of pageName in mw.ArticleTarget,
already set in mw.Target.
Change-Id: Iebd1def1d4142978a673afec584a0b663644d176
Avoid confusion by using `twoway` instead of `bidir`, which could be
confused with the Unicode bidirectional layout algorithm.
Depends-On: Ib59dff22e64f235e30778a5a5b3e525e4fc7fdd3
Change-Id: I7efb35245d48125b167dc0f0ef8f12aa0fff94e5
Implement special node types for language variant markup, so that they
display appropriately based on the currently-selected variant.
(Parsoid uses empty elements to represent this markup, so without this
patch anything in -{ ... }- is alienated and disappears.)
A follow-up patch will implement context items and inspectors to
allow editing these nodes. This patch is basic "read-only" support.
Depends on I4fcdebc2290ec35ba188f4c2e69d578791fbcd67 in Parsoid to
generate the appropriate markup, but this patch is safe to merge
independently.
Bug: T49411
Change-Id: Ie11e9301d2513bfe4a36036481cee9a047f46d37
This icon is now added by Parsoid content CSS.
Bug: T160960
Depends-On: Id66f09c54103854ccbaa54a03e7c62890b67cba9
Change-Id: I8d76d759641b091c1821ff658b1201ca625fd146
Remove config option `multiline` and change to MultilineTextInputWidget as
appropriate.
Bug: T169272
Change-Id: I45565f01de76a88d64d7b0691d1e7279354f375d
We were incorrectly handling transclusions with trailing
newlines after the template name.
This also improves handling of non-template transclusions,
e.g. parser functions like `{{int:mainpage}}`, which are
no longer mangled as if they were page names.
ve.dm.MWTransclusionNode#isSingleTemplate will now match
a template even if it's name is itself template-generated.
Logic for turning Parsoid's hrefs into page names stolen
from ve.dm.MWImageNode.prototype.getFilename.
Bug: T167613
Change-Id: Ibecf71338eb37bb3da81a7372e4ed41140a9af57
Back in de98382a55, references to MWTransclusionTableCell were introduced,
but weren't followed through on. So, actually add it. Have cellable
Transclusions use it as their type.
Bug: T144122
Depends-On: I054f12f4218102a12d7a9ea843f9c61e8825c52c
Change-Id: I367f878bfd1c58e20b62368cb78120604b48d791
Provide a utility funcition in ve.init.mw.LinkCache to do this.
Also use this in ve.ce.MWTransclusionNode/ve.ui.MWPreviewElement, and
introduce to ve.ce.MWExtenionNode
Bug: T73900
Bug: T153535
Change-Id: Ieb9a0274b8c5ae1932c431546f09d18000fa6dd9