Skip to content

Commit

Permalink
fix: backslash line break should not be allowed in table
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang committed Jan 17, 2021
1 parent 341e85f commit 1c0dbdc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion corpus/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,30 @@ ss_*.
(paragraph
(text)))

================================================================================
#14 - Assertion failed caused by unexpected backslash line break in table
================================================================================
*�wj\�2[
-|
&_&\


--------------------------------------------------------------------------------

(document
(table
(table_header_row
(table_cell
(text)))
(table_delimiter_row
(table_column_alignment))
(table_data_row
(table_cell
(text)))
(table_data_row
(table_cell
(text)))))

================================================================================
#14 - SIGSEGV caused by incorrect end condition for the unpaired link title
================================================================================
Expand All @@ -76,4 +100,3 @@ ss_*.
(document
(paragraph
(text)))

2 changes: 1 addition & 1 deletion src/tree_sitter_markdown/inline_scan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ bool scn_inl_bsl(Lexer &lxr, InlineDelimiterList &inl_dlms, InlineContextStack &
if (lxr.adv_if(is_asc_pun_chr)) {
if (lxr.cur_chr() == '\\' && lxr.lka_chr() == '|' && in_tbl) lxr.adv();
inl_dlms.insert(nxt_inl_dlm_itr, InlineDelimiter(true, SYM_BSL_ESC, bgn_pos, lxr.cur_pos()));
} else if (VLD(SYM_BSL_LBK) && is_lbk_chr(lxr.lka_chr())) {
} else if (VLD(SYM_BSL_LBK) && !in_tbl && is_lbk_chr(lxr.lka_chr())) {
LexedPosition bsl_end_pos = lxr.cur_pos();
BlockDelimiter *lit_brk = blk_dlms.lit_lbk(lxr.cur_row());
if (lit_brk == NULL_PTR) {
Expand Down

0 comments on commit 1c0dbdc

Please sign in to comment.