Skip to content

Commit

Permalink
Merge pull request #45 from MiguelDomingues/fix-literals-together-tas…
Browse files Browse the repository at this point in the history
…k-list

Fix issue when --keep-literals-together is used with Task List
  • Loading branch information
MiguelDomingues authored Oct 3, 2023
2 parents 581e3f6 + 37f84a8 commit 971377e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ private bool SkipChildTogether(Inline i)
case LineBreakInline:
case LinkInline l when l.IsImage:
case LiteralInline li when li.Content.ToString().Trim() == "":
case TaskList:
return true;
}
return false;
Expand Down
14 changes: 14 additions & 0 deletions test/MarkdownLocalize.Tests/MarkdownExtractStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -650,4 +650,18 @@ public void MultipleLiteralsTogetherBulletLink()
Assert.Equal(new string[] { "Label" }, strings);
}


[Fact]
public void MultipleLiteralsTogetherTaskList()
{
MarkdownParser.SetParserOptions(new RendererOptions()
{
KeepLiteralsTogether = true,
EnableGitHubFlavoredMarkdownTaskLists = true,
});
string md = @"- [x] Task list";

IEnumerable<string> strings = MarkdownParser.ExtractStrings(md, null).Select(si => si.String).Distinct();
Assert.Equal(new string[] { "Task list" }, strings);
}
}

0 comments on commit 971377e

Please sign in to comment.