diff --git a/lib/src/markdown_to_delta.dart b/lib/src/markdown_to_delta.dart index bb02179..c65de62 100644 --- a/lib/src/markdown_to_delta.dart +++ b/lib/src/markdown_to_delta.dart @@ -264,6 +264,12 @@ class MarkdownToDelta extends Converter } void _insertNewLineBeforeElementIfNeeded(md.Element element) { + // make sure this is not the first element + // in all other cases add a new line before p + if (_lastTag != null && element.tag == 'p') { + _delta.insert('\n'); + } + if (!_isInBlockQuote && _lastTag == 'blockquote' && element.tag == 'blockquote') {