Expand all

ve.ui.MWWikitextPlainTextStringTransferHandler

Extends

Constructor

new ve.ui.MWWikitextPlainTextStringTransferHandler(surface, item) #

Detect an attempt to paste plain text or wikitext, and allow it to be directly pasted without escaping it.

This handler is only registered in source mode, as that's the mode where users are interacting with the plain-text equivalent of the content already. Without this handler, a paste with text/plain and text/html content would take the html content, run it through the normal paste flow, then convert the resultant HTML into wikitext via parsoid. This would have the side-effect of escaping any wikitext content that's in the paste with nowiki, which probably isn't what the paster actually wants.

We also catch anything which has text/x-wiki, since it has explicitly come from a source-mode part of VE, and contains something that's definitely wikitext.

Parameters:

Name Type Description
surface ve.ui.Surface
item ve.ui.DataTransferItem
Source:
Detect an attempt to paste plain text or wikitext, and allow it to be directly pasted without escaping it.

Methods