Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div contenteditable><div><br></div></div>
<script>
"use strict";
const editingHost = document.querySelector("div[contenteditable]");
test(() => {
editingHost.focus();
document.execCommand("fontName", false, "monospace");
document.execCommand("insertText", false, "abc");
document.execCommand("insertParagraph");
document.execCommand("insertText", false, "def ");
document.execCommand("bold");
document.execCommand("insertText", false, "g");
assert_in_array(
editingHost.querySelector("div + div").innerHTML,
[
'<font face="monospace">def <b>g</b></font>',
'<font face="monospace">def <b>g<br></b></font>',
]
);
}, "");
</script>
</body>
</html>