From 9587bc4a5094a8b6be4d232957f1c7f8e92899fd Mon Sep 17 00:00:00 2001 From: David O'Trakoun Date: Tue, 10 Oct 2017 01:00:42 -0400 Subject: [PATCH] Sanitize tagName check (#1212) `In XML (and XML-based languages such as XHTML), tagName preserves case. On HTML elements in DOM trees flagged as HTML documents, tagName returns the element name in the uppercase form.` --- packages/slate-html-serializer/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/slate-html-serializer/src/index.js b/packages/slate-html-serializer/src/index.js index b7e689963..99b5fe7e1 100644 --- a/packages/slate-html-serializer/src/index.js +++ b/packages/slate-html-serializer/src/index.js @@ -27,7 +27,7 @@ const String = new Record({ const TEXT_RULE = { deserialize(el) { - if (el.tagName == 'br') { + if (el.tagName.toLowerCase() == 'br') { return { kind: 'text', ranges: [{ text: '\n' }],