aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 19:32:29 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 19:32:29 +0200
commit5141bef7df4bfdfa30315491a2e7c440a5be38f4 (patch)
tree66a12c7915f39dd8e2495ec847714db3358b5257 /src/construct
parent218cf7a77f3b487a003b45adfb3687e52bdfdfe9 (diff)
downloadmarkdown-rs-5141bef7df4bfdfa30315491a2e7c440a5be38f4.tar.gz
markdown-rs-5141bef7df4bfdfa30315491a2e7c440a5be38f4.tar.bz2
markdown-rs-5141bef7df4bfdfa30315491a2e7c440a5be38f4.zip
Remove some unused code in gfm tables
Diffstat (limited to 'src/construct')
-rw-r--r--src/construct/gfm_table.rs34
1 files changed, 7 insertions, 27 deletions
diff --git a/src/construct/gfm_table.rs b/src/construct/gfm_table.rs
index 547358f..58b7110 100644
--- a/src/construct/gfm_table.rs
+++ b/src/construct/gfm_table.rs
@@ -661,38 +661,18 @@ pub fn body_row_start(tokenizer: &mut Tokenizer) -> State {
match tokenizer.current {
Some(b'\t' | b' ') => {
- tokenizer.attempt(State::Next(StateName::GfmTableBodyRowBefore), State::Nok);
-
- State::Retry(space_or_tab_min_max(
- tokenizer,
- 0,
- if tokenizer.parse_state.options.constructs.code_indented {
- TAB_SIZE - 1
- } else {
- usize::MAX
- },
- ))
+ tokenizer.attempt(State::Next(StateName::GfmTableBodyRowBreak), State::Nok);
+ // We’re parsing a body row.
+ // If we’re here, we already attempted blank lines and indented
+ // code.
+ // So parse as much whitespace as needed:
+ State::Retry(space_or_tab_min_max(tokenizer, 0, usize::MAX))
}
- _ => State::Retry(StateName::GfmTableBodyRowBefore),
+ _ => State::Retry(StateName::GfmTableBodyRowBreak),
}
}
}
-/// Before table body row, after optional whitespace.
-///
-/// ```markdown
-/// | | a |
-/// | | - |
-/// > | | b |
-/// ^
-/// ```
-pub fn body_row_before(tokenizer: &mut Tokenizer) -> State {
- match tokenizer.current {
- Some(b'\t' | b' ') => State::Nok,
- _ => State::Retry(StateName::GfmTableBodyRowBreak),
- }
-}
-
/// At break in table body row.
///
/// ```markdown