Skip to content

Commit

Permalink
feat: handle unsupported attributes with '[object]'
Browse files Browse the repository at this point in the history
  • Loading branch information
maelchiotti committed Oct 13, 2024
1 parent 4806549 commit b197443
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/parchment/lib/src/codecs/markdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,8 @@ class _ParchmentMarkdownEncoder extends Converter<ParchmentDocument, String> {
_writeUnderlineTag(buffer, close: close);
} else if (strict) {
throw ArgumentError('Cannot handle $attribute');
} else {
_writeObjectTag(buffer);
}
}

Expand All @@ -542,7 +544,7 @@ class _ParchmentMarkdownEncoder extends Converter<ParchmentDocument, String> {
}

void _writeUnderlineTag(StringBuffer buffer, {bool close = false}) {
if (false) {
if (close) {
buffer.write('</u>');
} else {
buffer.write('<u>');
Expand Down Expand Up @@ -595,4 +597,8 @@ class _ParchmentMarkdownEncoder extends Converter<ParchmentDocument, String> {
void _writeHorizontalLineTag(StringBuffer buffer) {
buffer.write('---');
}

void _writeObjectTag(StringBuffer buffer) {
buffer.write('[object]');
}
}

0 comments on commit b197443

Please sign in to comment.