-
Notifications
You must be signed in to change notification settings - Fork 204
Fix parsing of inline code blocks with multiple backticks #260
Fix parsing of inline code blocks with multiple backticks #260
Conversation
The failed internal check is fine; we have a broken patch file. |
bool canParse(BlockParser parser) { | ||
var match = pattern.firstMatch(parser.current); | ||
if (match == null) return false; | ||
final codeFence = match.group(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use var
here and below or final
above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
lib/src/block_parser.dart
Outdated
// | ||
// > If the info string comes after a backtick fence, it may not contain | ||
// > any backtick characters. | ||
if (codeFence.codeUnitAt(0) == $backquote && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
return codeFence.codeUnitAt(0) != $backquote ||
!infoString.codeUnits.contains($backquote));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bool canParse(BlockParser parser) { | ||
var match = pattern.firstMatch(parser.current); | ||
if (match == null) return false; | ||
final codeFence = match.group(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
lib/src/block_parser.dart
Outdated
// | ||
// > If the info string comes after a backtick fence, it may not contain | ||
// > any backtick characters. | ||
if (codeFence.codeUnitAt(0) == $backquote && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Land it! |
…ve/markdown#260) Fix parsing of inline code blocks with multiple backticks
Fixes dart-lang/tools#1406