Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: lib/src/inline_parser.dart

Issue 1340143003: Ignore underscores in the middle of words. (Closed) Base URL: https://github.com/dart-lang/markdown.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« CHANGELOG.md ('K') | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/inline_parser.dart
diff --git a/lib/src/inline_parser.dart b/lib/src/inline_parser.dart
index 3b1d9faa327e37eda63a04ed6e5ffc8c713de919..9f0db08c5d04e1748a96dce4f9a0d52a58a4683f 100644
--- a/lib/src/inline_parser.dart
+++ b/lib/src/inline_parser.dart
@@ -43,13 +43,11 @@ class InlineParser {
// Parse "**strong**" tags.
new TagSyntax(r'\*\*', tag: 'strong'),
// Parse "__strong__" tags.
- new TagSyntax(r'__', tag: 'strong'),
+ new TagSyntax(r'\b__', tag: 'strong', end: r'__\b'),
nweiz 2015/09/14 21:52:13 Using \b here isn't very non-English-friendly; it'
Bob Nystrom 2015/09/15 00:19:16 Hmm, good point. I think this is sort of a stopgap
// Parse "*emphasis*" tags.
new TagSyntax(r'\*', tag: 'em'),
// Parse "_emphasis_" tags.
- // TODO(rnystrom): Underscores in the middle of a word should not be
- // parsed as emphasis like_in_this.
- new TagSyntax(r'_', tag: 'em'),
+ new TagSyntax(r'\b_', tag: 'em', end: r'_\b'),
new CodeSyntax(),
// We will add the LinkSyntax once we know about the specific link resolver.
];
« CHANGELOG.md ('K') | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698