@@ -164,6 +164,9 @@ para = B.para . trimInlines . mconcat <$> many1 inline
164table :: MWParser Blocks
164table :: MWParser Blocks
165table = do
165table = do
166 tableStart
166 tableStart
167+ styles <- manyTill anyChar newline
168+ let tableWidth = maybe (1.0 :: Double) read
169+ $ lookup "width" $ parseAttrs styles
167 caption <- option mempty tableCaption
170 caption <- option mempty tableCaption
168 optional rowsep
171 optional rowsep
169 hasheader <- option False $ True <$ (lookAhead (char '!'))
172 hasheader <- option False $ True <$ (lookAhead (char '!'))
@@ -178,8 +181,22 @@ table = do
178 let cellspecs = replicate cols (AlignDefault, 0.0)
181 let cellspecs = replicate cols (AlignDefault, 0.0)
179 return $ B.table caption cellspecs headers rows
182 return $ B.table caption cellspecs headers rows
184+parseAttrs :: String -> [(String,String)]
185+parseAttrs s = case parse (many parseAttr) "attributes" s of
189+parseAttr :: Parser String () (String, String)
195+ v <- many1Till anyChar (char '"')
181tableStart :: MWParser ()
198tableStart :: MWParser ()
182−tableStart = try $ guardColumnOne *> sym "{|" <* blanklines
199+tableStart = try $ guardColumnOne *> sym "{|"
184tableEnd :: MWParser ()
201tableEnd :: MWParser ()
185tableEnd = try $ guardColumnOne *> sym "|}" <* blanklines
202tableEnd = try $ guardColumnOne *> sym "|}" <* blanklines