mediawiki-extensions-Visual.../modules/ve-mw/dm/nodes
Bartosz Dziewoński 86f2057c81 Always generate empty wrapper paragraph inside image captions (slugs begone!)
While all of the following are valid in the model:

1. <mwBlockImage></mwBlockImage>
   Image with no caption. Must use the media dialog to insert one.
2. <mwBlockImage><mwImageCaption></mwImageCaption></mwBlockImage>
   Image with empty caption. There is a slug to insert a paragraph.
3. <mwBlockImage><mwImageCaption><paragraph></paragraph></mwImageCaption></mwBlockImage>
   Image with caption with empty paragraph. Nice and intuitive!

(Same for <mwGalleryImage> / <mwGalleryImageCaption>.)

The third option is the most convenient for the user. We should always
generate that when converting documents from HTML and from the editing
tools (MWGalleryDialog, MWMediaDialog/MWImageModel).

Previously, the editing tools generated option 2 if no caption text
was entered, and the converter generated option 2 if there was no
caption node or if it was empty. Curiously, option 1 was never used.

Wikitext for manual testing:

```
[[File:Foo.png|thumb]]
[[File:Foo.png|thumb|]]
[[File:Foo.png|thumb|Caption]]

<gallery mode="packed">
File:Foo.png
File:Foo.png|
File:Foo.png|Caption
</gallery>
```

Bug: T200387
Change-Id: Ie82fb339f6bd8ae1b289235bf5402490722d9a7c
2018-08-01 05:40:57 +02:00
..
ve.dm.MWAlienExtensionNode.js
ve.dm.MWBlockImageNode.js Always generate empty wrapper paragraph inside image captions (slugs begone!) 2018-08-01 05:40:57 +02:00
ve.dm.MWEntityNode.js
ve.dm.MWExtensionNode.js Convert most uses of isForClipboard to doesModeNeedRendering 2018-04-30 16:10:27 +00:00
ve.dm.MWGalleryCaptionNode.js Make gallery dialog work with native gallery implementation 2018-03-19 23:55:17 +01:00
ve.dm.MWGalleryImageCaptionNode.js Make gallery dialog work with native gallery implementation 2018-03-19 23:55:17 +01:00
ve.dm.MWGalleryImageNode.js Always generate empty wrapper paragraph inside image captions (slugs begone!) 2018-08-01 05:40:57 +02:00
ve.dm.MWGalleryNode.js GalleryNode: Pass through all arguments in describeChanges override 2018-04-04 18:00:41 +01:00
ve.dm.MWHeadingNode.js Revert "For empty / whitespace-only headings, output <p> instead of <h#>" 2018-03-05 23:27:52 +00:00
ve.dm.MWImageCaptionNode.js
ve.dm.MWImageNode.js Update VE core submodule to master (a1fd90540) 2018-06-20 12:53:43 +02:00
ve.dm.MWInlineImageNode.js ve.dm.MWInlineImageNode: Fix undefined data-mw in toDomElements output 2018-07-18 16:46:07 +05:30
ve.dm.MWLanguageVariantNode.js Convert most uses of isForClipboard to doesModeNeedRendering 2018-04-30 16:10:27 +00:00
ve.dm.MWMagicLinkNode.js
ve.dm.MWNumberedExternalLinkNode.js Fix parsing of external links, now Parsoid adds 'external' classes 2018-06-01 08:47:46 +00:00
ve.dm.MWPreformattedNode.js
ve.dm.MWPreNode.js
ve.dm.MWSignatureNode.js
ve.dm.MWTableNode.js
ve.dm.MWTransclusionNode.js Fix template param diff when value is empty string 2018-05-28 14:56:53 +01:00