dart-lang / markdown

A Dart markdown library
https://pub.dev/packages/markdown
BSD 3-Clause "New" or "Revised" License
455 stars 200 forks source link

Line breaks are ignored #615

Open sundar-karpura opened 5 months ago

sundar-karpura commented 5 months ago

For the issue reported in markdown_quill, the fix may be in this repo. Could you please investigate this? The fix may be in EmptyBlockSyntax.

      @override
      Node? parse(BlockParser parser) {
        parser.encounteredBlankLine = true;
        parser.advance();

        // Don't actually emit anything.
        // return null;
        return Element('br', null);  // this change seems to work for my use case, but I have not tested fully.
      }
srawlins commented 5 months ago

Thanks for filing an issue, can you please explain here what the issue is which you have encountered, including the steps to reproduce, the expected output, and the actual output?

sundar-karpura commented 5 months ago

Thanks for filing an issue, can you please explain here what the issue is which you have encountered, including the steps to reproduce, the expected output, and the actual output?

Please check the following associated issue, which includes example for reproducing the issue: https://github.com/TarekkMA/markdown_quill/issues/20

srawlins commented 5 months ago

Sorry, the summary of that issue doesn't really spell out the issue either. I can't read the whole thread to try and tease out what the issue might be with the markdown package.

matt3o commented 1 month ago

I think this is not an issue with the markdown parser, so this can probably be closed. Markdown quill "swallows" new lines in some instances, however, I think it can be tracked down to incorrect conversion in the library itself, see https://github.com/TarekkMA/markdown_quill/pull/37

DGrothe-PhD commented 1 month ago

Markdown itself ignores multiple linebreaks. See https://github.com/TarekkMA/markdown_quill/issues/20#issuecomment-2446943221 for example...