@@ -133,14 +133,14 @@ commentBlock = try $ do
133 return mempty
133 return mempty
135codeBlock :: PandocMonad m => ParserT Text ParserState m Blocks
135codeBlock :: PandocMonad m => ParserT Text ParserState m Blocks
136−codeBlock = codeBlockBc <|> codeBlockPre
136+codeBlock = codeBlockTextile <|> codeBlockHtml
138−codeBlockBc :: PandocMonad m => ParserT Text ParserState m Blocks
138+codeBlockTextile :: PandocMonad m => ParserT Text ParserState m Blocks
139−codeBlockBc = try $ do
139+codeBlockTextile = try $ do
140− string "bc."
140+ string "bc." <|> string "pre."
141 extended <- option False (True <$ char '.')
141 extended <- option False (True <$ char '.')
143− let starts = ["p", "table", "bq", "bc", "h1", "h2", "h3",
143+ let starts = ["p", "table", "bq", "bc", "pre", "h1", "h2", "h3",
144 "h4", "h5", "h6", "pre", "###", "notextile"]
144 "h4", "h5", "h6", "pre", "###", "notextile"]
145 let ender = choice $ map explicitBlockStart starts
145 let ender = choice $ map explicitBlockStart starts
146 contents <- if extended
146 contents <- if extended
@@ -155,8 +155,8 @@ trimTrailingNewlines :: Text -> Text
155trimTrailingNewlines = T.dropWhileEnd (=='\n')
155trimTrailingNewlines = T.dropWhileEnd (=='\n')
157-- | Code Blocks in Textile are between <pre> and </pre>
157-- | Code Blocks in Textile are between <pre> and </pre>
158−codeBlockPre :: PandocMonad m => ParserT Text ParserState m Blocks
158+codeBlockHtml :: PandocMonad m => ParserT Text ParserState m Blocks
159−codeBlockPre = try $ do
159+codeBlockHtml = try $ do
160 (t@(TagOpen _ attrs),_) <- htmlTag (tagOpen (=="pre") (const True))
160 (t@(TagOpen _ attrs),_) <- htmlTag (tagOpen (=="pre") (const True))
161 result' <- T.pack <$> manyTill anyChar (htmlTag (tagClose (=="pre")))
161 result' <- T.pack <$> manyTill anyChar (htmlTag (tagClose (=="pre")))
162 -- drop leading newline if any
162 -- drop leading newline if any
@@ -243,7 +243,7 @@ genericListItemAtDepth :: PandocMonad m => Char -> Int -> ParserT Text ParserSta
243genericListItemAtDepth c depth = try $ do
243genericListItemAtDepth c depth = try $ do
244 count depth (char c) >> attributes >> whitespace
244 count depth (char c) >> attributes >> whitespace
245 contents <- mconcat <$> many ((B.plain . mconcat <$> many1 inline) <|>
245 contents <- mconcat <$> many ((B.plain . mconcat <$> many1 inline) <|>
246− try (newline >> codeBlockPre))
246+ try (newline >> codeBlockHtml))
248 sublist <- option mempty (anyListAtDepth (depth + 1))
248 sublist <- option mempty (anyListAtDepth (depth + 1))
249 return $ contents <> sublist
249 return $ contents <> sublist