Closed vishna closed 2 months ago
@TarekkMA done
Attention: Patch coverage is 95.45455%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 94.20%. Comparing base (
f8889f9
) to head (a34470c
). Report is 3 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
lib/src/delta_to_markdown.dart | 95.45% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What is this PR about?
Currently all special characters (that are part of markdown syntax) are getting escaped, e.g.
.
becomes\.
when converting from quill to markdown. This is a reasonable but not always a desirable approach.This PR adds customization of this behavior.
Description of changes
visitText
to a separate static method calledescapeSpecialCharacters
CustomContentHandler
and make it available as a constructor parameter ofDeltaToMarkdown
escapeSpecialCharacters
by defaultescapeSpecialCharactersRelaxed
that conforms to the signature ofCustomContentHandler
and also escapes special characters, but only when text is styled, meaning fullstops should be omitted.