mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 00:00:49 +00:00
Add regex for detecting labelled external links in pasted wikitext
Bug: T134227 Change-Id: Icb390cca6f4ee299dd59ec5d15894b734879f394
This commit is contained in:
parent
0bc4aff46c
commit
47508d3245
|
@ -20,11 +20,22 @@ ve.ui.mwWikitextTransferRegistry.register(
|
|||
);
|
||||
|
||||
ve.ui.mwWikitextTransferRegistry.register(
|
||||
'link',
|
||||
'internalLink',
|
||||
// [[...]] on a single line of max 80 characters
|
||||
/\[\[.{1,80}\]\]/m
|
||||
);
|
||||
|
||||
ve.init.platform.getInitializedPromise().done( function () {
|
||||
ve.ui.mwWikitextTransferRegistry.register(
|
||||
'externalLink',
|
||||
// [url label]
|
||||
new RegExp(
|
||||
'\\[' + ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegExp().source + '\\S+ [^\\]]+\\]',
|
||||
'i'
|
||||
)
|
||||
);
|
||||
} );
|
||||
|
||||
ve.ui.mwWikitextTransferRegistry.register(
|
||||
'template',
|
||||
'{{'
|
||||
|
|
Loading…
Reference in a new issue