mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 18:09:49 +02:00
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.`
This commit is contained in:
committed by
Ian Storm Taylor
parent
e0d7122881
commit
9587bc4a50
@@ -27,7 +27,7 @@ const String = new Record({
|
|||||||
const TEXT_RULE = {
|
const TEXT_RULE = {
|
||||||
|
|
||||||
deserialize(el) {
|
deserialize(el) {
|
||||||
if (el.tagName == 'br') {
|
if (el.tagName.toLowerCase() == 'br') {
|
||||||
return {
|
return {
|
||||||
kind: 'text',
|
kind: 'text',
|
||||||
ranges: [{ text: '\n' }],
|
ranges: [{ text: '\n' }],
|
||||||
|
Reference in New Issue
Block a user