From 103a06ae674406055d3a050653a8518b9e89683a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C4=81rlis=20Ga=C5=86=C4=A3is?= Date: Sun, 29 Jan 2017 21:08:31 +0200 Subject: [PATCH] Fix using tabs for list items. Fixes #108 --- CommonMark.Tests/ListTests.cs | 7 +++++++ CommonMark/Parser/BlockMethods.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CommonMark.Tests/ListTests.cs b/CommonMark.Tests/ListTests.cs index 14d82f0..6c55436 100644 --- a/CommonMark.Tests/ListTests.cs +++ b/CommonMark.Tests/ListTests.cs @@ -39,6 +39,13 @@ public void ListWithTabs() Helpers.ExecuteTest("*\tbar", ""); } + [TestMethod] + [TestCategory("Container blocks - List items")] + public void ListWithTabs2() + { + Helpers.ExecuteTest("* foo\n\t* i1\n\t* i2", ""); + } + [TestMethod] [TestCategory("Container blocks - List items")] public void UnicodeBulletEscape() diff --git a/CommonMark/Parser/BlockMethods.cs b/CommonMark/Parser/BlockMethods.cs index b934011..52360ed 100644 --- a/CommonMark/Parser/BlockMethods.cs +++ b/CommonMark/Parser/BlockMethods.cs @@ -637,7 +637,7 @@ public static void IncorporateLine(LineInfo line, ref Block curptr) FindFirstNonspace(ln, offset, column, out first_nonspace, out first_nonspace_column, out curChar); - indent = first_nonspace_column - column; + indent = first_nonspace_column - column + remainingSpaces; blank = curChar == '\n'; var indented = indent >= CODE_INDENT;