From 410991ec6e3615613db5d7f58f8ec8221373d5fd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Mar 2017 12:28:13 +0100 Subject: Org reader: don't allow tables inside list items. Closes #3499. --- src/Text/Pandoc/Readers/Org/Blocks.hs | 4 ++++ test/command/3499.md | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/command/3499.md diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs index a5311e8f4..72d1f31dc 100644 --- a/src/Text/Pandoc/Readers/Org/Blocks.hs +++ b/src/Text/Pandoc/Readers/Org/Blocks.hs @@ -721,6 +721,10 @@ data OrgTable = OrgTable table :: PandocMonad m => OrgParser m (F Blocks) table = try $ do + -- don't allow a table inside a list item; org requires that + -- tables start at first non-space character on the line + ctx <- orgStateParserContext <$> getState + guard (ctx == NullState) blockAttrs <- blockAttributes lookAhead tableStart do diff --git a/test/command/3499.md b/test/command/3499.md new file mode 100644 index 000000000..e1c9093c4 --- /dev/null +++ b/test/command/3499.md @@ -0,0 +1,9 @@ +Org-mode tables can't go in lists: +``` +% pandoc -f org +- |something| +^D + +``` -- cgit v1.2.3