@tiptap/core 2.1.14 → 2.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1609,6 +1609,7 @@ function createNodeFromContent(content, schema, options) {
1609
1609
  }
1610
1610
  }
1611
1611
  if (typeof content === 'string') {
1612
+ content = content.split('\n').map(part => part.trim()).join(''); // we need to remove new lines since the parser will add breaks
1612
1613
  const parser = DOMParser.fromSchema(schema);
1613
1614
  return options.slice
1614
1615
  ? parser.parseSlice(elementFromString(content), options.parseOptions).content