Skip to content

Commit

Permalink
fix: table with same indentation in list item is now recognized
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang committed Oct 6, 2019
1 parent 0a5a3c5 commit ec8e9fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions corpus/custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ Table (extension) - same indentation in list item [is table]
(tight_list
(list_item
(list_marker)
(paragraph
(soft_line_break)))))
(table
(table_header_row
(table_cell)
(table_cell))
(table_delimiter_row
(table_column_alignment)
(table_column_alignment))))))

================================================================================
Table (extension) - less indentation in list item [is NOT table]
Expand Down
2 changes: 1 addition & 1 deletion src/tree_sitter_markdown/block_scan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void scn_blk(Lexer &lxr, BlockDelimiterList &blk_dlms, const BlockContextStack &
bool is_pas_all_blk_ctx = ctx_itr == ctx_end
&& (blk_ctx_stk.empty() || !is_lst_itm_bgn(blk_ctx_stk.back().sym())
? cur_ind < 4
: cur_ind > ind && cur_ind - ind < 4);
: cur_ind >= ind && cur_ind - ind < 4);
if (is_pas_all_blk_ctx && !is_eol_chr(lxr.lka_chr()) && scn_tbl_dlm_row(lxr, tbl_col_cnt)) {
is_tbl = true;
tmp_blk_dlms.push_back(BlockDelimiter(SYM_TBL_HED_ROW_BGN_MKR, bgn_pos, bgn_pos));
Expand Down

0 comments on commit ec8e9fd

Please sign in to comment.