Skip to content

Commit

Permalink
TW-1135: Preserve user linebreaks on markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian KOUNE committed Jan 8, 2024
1 parent 2396093 commit d7dca28
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lib/src/utils/markdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,6 @@ class MentionSyntax extends InlineSyntax {
}
}

class MultipleLinebreaksSyntax extends InlineSyntax {
MultipleLinebreaksSyntax() : super(r'\n{2,}');

@override
bool onMatch(InlineParser parser, Match match) {
parser.addNode(Element.empty('br'));
return true;
}
}

String markdown(
String text, {
Map<String, Map<String, String>> Function()? getEmotePacks,
Expand All @@ -228,14 +218,12 @@ String markdown(
],
inlineSyntaxes: [
StrikethroughSyntax(),
MultipleLinebreaksSyntax(),
SpoilerSyntax(),
EmoteSyntax(getEmotePacks),
PillSyntax(),
MentionSyntax(getMention),
InlineLatexSyntax(),
],
inlineOnly: true,
);

var stripPTags = '<p>'.allMatches(ret).length <= 1;
Expand Down

0 comments on commit d7dca28

Please sign in to comment.