Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with cmark-gfm-0.29.0.gfm.13 #345

Merged
1 commit merged into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Collective](https://opencollective.com/comrak/all/badge.svg?label=financial+cont
[![crates.io version](https://img.shields.io/crates/v/comrak.svg)](https://crates.io/crates/comrak)
[![docs.rs](https://docs.rs/comrak/badge.svg)](https://docs.rs/comrak)

Rust port of [github's `cmark-gfm`](https://github.com/github/cmark). *Currently synced with release `0.29.0.gfm.12`*.
Rust port of [github's `cmark-gfm`](https://github.com/github/cmark). *Currently synced with release `0.29.0.gfm.13`*.

- [Installation](#installation)
- [Usage](#usage)
Expand Down
8 changes: 4 additions & 4 deletions src/parser/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ fn try_opening_header<'a>(
return Some((container, false, false));
}

let marker_row = match row(&line[parser.first_nonspace..]) {
Some(marker_row) => marker_row,
let delimiter_row = match row(&line[parser.first_nonspace..]) {
Some(delimiter_row) => delimiter_row,
None => return Some((container, false, true)),
};

Expand All @@ -52,7 +52,7 @@ fn try_opening_header<'a>(
None => return Some((container, false, true)),
};

if header_row.cells.len() != marker_row.cells.len() {
if header_row.cells.len() != delimiter_row.cells.len() {
return Some((container, false, true));
}

Expand All @@ -61,7 +61,7 @@ fn try_opening_header<'a>(
}

let mut alignments = vec![];
for cell in marker_row.cells {
for cell in delimiter_row.cells {
let cell_content = cell.content.as_bytes();
let left = !cell_content.is_empty() && cell_content[0] == b':';
let right = !cell_content.is_empty() && cell_content[cell_content.len() - 1] == b':';
Expand Down
4 changes: 2 additions & 2 deletions src/scanners.re
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub fn dangerous_url(s: &[u8]) -> Option<usize> {
table_spacechar = [ \t\v\f];
table_newline = [\r]?[\n];

table_marker = (table_spacechar*[:]?[-]+[:]?table_spacechar*);
table_delimiter = (table_spacechar*[:]?[-]+[:]?table_spacechar*);
table_cell = (escaped_char|[^\x00|\r\n])+;

*/
Expand All @@ -326,7 +326,7 @@ pub fn table_start(s: &[u8]) -> Option<usize> {
let mut marker = 0;
let len = s.len();
/*!re2c
[|]? table_marker ([|] table_marker)* [|]? table_spacechar* table_newline {
[|]? table_delimiter ([|] table_delimiter)* [|]? table_spacechar* table_newline {
return Some(cursor);
}
* { return None; }
Expand Down