Skip to content

Commit 67dda82

Browse files
committed
is it done?
1 parent 811b3fa commit 67dda82

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/MyMark.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ module MyMark (prefixImageUrl) where
55
import CMarkGFM
66
import Data.Text qualified as T
77

8+
tableCellToHTML :: Node -> T.Text
9+
tableCellToHTML (Node _ _ nodes) = "<td>\n" <> T.intercalate "" (map (CMarkGFM.nodeToHtml [] []) (workOnInlineMath nodes)) <> "\n</td>"
10+
11+
tableRowToHTML :: Node -> T.Text
12+
tableRowToHTML (Node _ _ nodes) = "<tr>\n" <> T.intercalate "\n" (map tableCellToHTML nodes) <> "\n</tr>"
13+
814
tableToInlineHTML :: [TableCellAlignment] -> [Node] -> Node
9-
tableToInlineHTML _ _ = Node Nothing (HTML_BLOCK "some table") []
15+
tableToInlineHTML _ nodes = Node Nothing (HTML_BLOCK $ "<table>\n" <> T.intercalate "\n" (map tableRowToHTML nodes) <> "\n</table>") []
1016

1117
prefixImageUrl :: String -> Node -> Node
1218
prefixImageUrl prefix node =

0 commit comments

Comments
 (0)