mediawiki-extensions-Visual.../modules/ve-mw/ui
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
..
actions
commands
contextitems Update link contexts with label info from core 2018-06-26 21:16:53 +00:00
datatransferhandlers Add a plain text paste transfer handler for source mode 2018-04-22 12:52:56 -05:00
dialogs Always generate empty wrapper paragraph inside image captions (slugs begone!) 2018-08-01 05:40:57 +02:00
elements Add missing mw-content-(dir) class to MWPreviewElement 2018-05-11 16:59:12 +00:00
inspectors Make link annotations more flexible 2018-07-26 15:12:19 +02:00
pages ve.ui.MWTemplatePlaceholderPage: Avoid Firefox rendering issue 2018-07-03 20:13:28 +02:00
styles MWWelcomeDialog: Shrink the background image by 1/3 so the CTAs show 2018-07-05 20:04:57 +02:00
themes Update custom styles for format menu after OOUI changes 2018-04-26 01:48:28 +02:00
tools Fix typo in API call for version number help 2018-05-16 10:23:39 +01:00
widgets build: Enable and make pass no-prototype-builtins 2018-07-06 10:58:18 -07:00
ve.ui.MWCommandRegistry.js
ve.ui.MWExtensionWindow.js
ve.ui.MWSequenceRegistry.js
ve.ui.MWSurface.js Create an MWSurface and move langChange handling there 2018-05-07 11:53:23 +01:00
ve.ui.MWWikitextCommandRegistry.js
ve.ui.MWWikitextDataTransferHandlerFactory.js
ve.ui.MWWikitextSequenceRegistry.js
ve.ui.MWWikitextSurface.js Create an MWSurface and move langChange handling there 2018-05-07 11:53:23 +01:00
ve.ui.MWWikitextTransferRegistry.js