Skip to content

Commit b2a7c3e

Browse files
committed
feat: support table
1 parent 1506572 commit b2a7c3e

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

mdast_util_to_markdown/src/construct_name.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,29 @@ pub enum ConstructName {
250250
/// ^^^
251251
/// ```
252252
TitleQuote,
253+
/// Table.
254+
///
255+
/// ```markdown
256+
/// > | | a | b |
257+
/// ^^^^^^^^^
258+
/// > | | - | - |
259+
/// ^^^^^^^^^
260+
/// > | | c | d |
261+
/// ^^^^^^^^^
262+
/// ```
263+
Table,
264+
/// Table row.
265+
///
266+
/// ```markdown
267+
/// > | | a | b |
268+
/// ^^^^^^^^^
269+
/// ```
270+
TableRow,
271+
/// Table cell.
272+
///
273+
/// ```markdown
274+
/// > | | a | b |
275+
/// ^ ^
276+
/// ```
277+
TableCell,
253278
}

mdast_util_to_markdown/src/handle/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ mod math;
2121
mod paragraph;
2222
mod root;
2323
pub mod strong;
24+
mod table;
2425
mod text;
2526
mod thematic_break;
2627

mdast_util_to_markdown/src/state.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ impl<'a> State<'a> {
325325
Node::ThematicBreak(thematic_break) => thematic_break.handle(self, info, parent, node),
326326
Node::Math(math) => math.handle(self, info, parent, node),
327327
Node::InlineMath(inline_math) => inline_math.handle(self, info, parent, node),
328+
Node::Table(table) => table.handle(self, info, parent, node),
329+
Node::TableRow(table_row) => table_row.handle(self, info, parent, node),
330+
Node::TableCell(table_cell) => table_cell.handle(self, info, parent, node),
328331
_ => Err(Message {
329332
place: None,
330333
reason: format!("Unexpected node type `{:?}`", node),

0 commit comments

Comments
 (0)