diff --git a/.gitignore b/.gitignore index 5ea5861993a..b0c874e5d16 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,10 @@ jspm_packages # macOS finder cache file .DS_Store +# Intellij +.idea +*.iml + # VS Code settings /.vscode diff --git a/packages/@sanity/block-tools/src/HtmlDeserializer/rules/html.ts b/packages/@sanity/block-tools/src/HtmlDeserializer/rules/html.ts index 5f967504de2..9caf4ce55de 100644 --- a/packages/@sanity/block-tools/src/HtmlDeserializer/rules/html.ts +++ b/packages/@sanity/block-tools/src/HtmlDeserializer/rules/html.ts @@ -111,7 +111,7 @@ export default function createHTMLRules( return undefined } // Don't add blocks into list items - if (el.parentNode && tagName(el) === 'li') { + if (el.parentNode && tagName(el.parentNode) === 'li') { return next(el.childNodes) } // If style is not supported, return a defaultBlockType diff --git a/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/input.html b/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/input.html index 9898b0379c5..7b2fa783bdb 100644 --- a/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/input.html +++ b/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/input.html @@ -22,6 +22,10 @@
  • Link
  • +
  • +

    p in li.

    +

    block children are still processed.

    +
  • diff --git a/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/output.json b/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/output.json index 81f4fd8325f..2f2f8193666 100644 --- a/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/output.json +++ b/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/output.json @@ -126,5 +126,27 @@ } ], "style": "normal" + }, + { + "_key": "randomKey8", + "_type": "block", + "children": [ + { + "_key": "randomKey80", + "_type": "span", + "marks": [], + "text": "p in li. block children are still " + }, + { + "_key": "randomKey81", + "_type": "span", + "marks": ["strong"], + "text": "processed." + } + ], + "level": 1, + "listItem": "bullet", + "markDefs": [], + "style": "normal" } -] \ No newline at end of file +]