Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-229

Pasted HTML never brings active content

When the clipboard HTML of a paste is converted, the extension SHALL drop script, style, embedded, form control, media and template elements, comments and hidden content, read only a short list of attributes, and keep only the text of a link or image whose address is not safe.

Another outcome at step 2 of path 2 in StRS-MDOKFSTUDIO-PALETTE-018, in the state “The host converts the HTML”.

Scenarios 3

The situations the tests check; open one to read it.

nominalScripts, styles, comments and hidden content are dropped
Givena script, a style and a paragraph with an onclick attribute, and a span with display none
Whenthe HTML is converted
Thenonly the text of the paragraph is kept and the text of the hidden span is dropped
InputOutcome
script, style, head, iframe, object, embed, svg, math, form control, media or template elementdropped from the Markdown
commentdropped from the Markdown
content hidden by the hidden attributedropped from the Markdown
content hidden by the style display none, visibility hidden or mso-hide alldropped from the Markdown
nominalOnly a few attributes are read
Givena link with an href and a title, and a paragraph with an onclick attribute
Whenthe HTML is converted
Thenthe href is used, the title is dropped and the onclick attribute has no effect on the Markdown
InputOutcome
attribute href, src, alt, class, style, colspan, rowspan, type, checked or startread
any other attribute (an event attribute such as onclick, title)dropped; no other attribute reaches the output
refusalAn unsafe address keeps only the text
Givena link to javascript:alert(1) with the text click, and an image with a data: address and alt text pic
Whenthe HTML is converted
Thenthe text is click without a link, and the text is pic
Address of the link or imageOutcome
http, https, mailto or tel addressaccepted
fragmentaccepted
relative path (without a scheme colon before its first slash)accepted
any other scheme, such as javascript:only the text is kept
address that holds a control characteronly the text is kept
data: imageonly its alternative text is kept

Implemented in 1

Tested by 2