aboutsummaryrefslogtreecommitdiffstats
path: root/src/state.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-09-05 15:03:24 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-09-05 15:03:24 +0200
commit3d00bf57a225369120fd98bee36f65a541260da1 (patch)
tree65780bdbc880f06ba3c92d8c5dbddbdd00ccb92e /src/state.rs
parent16de10fe2395002644d685fdfcf76823346d1cc4 (diff)
downloadmarkdown-rs-3d00bf57a225369120fd98bee36f65a541260da1.tar.gz
markdown-rs-3d00bf57a225369120fd98bee36f65a541260da1.tar.bz2
markdown-rs-3d00bf57a225369120fd98bee36f65a541260da1.zip
Fix to implement GFM autolink literals exactly
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs
index 5013ec8..d7c0c8a 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -310,6 +310,29 @@ pub enum Name {
StringBefore,
StringBeforeData,
+ GfmAutolinkLiteralProtocolStart,
+ GfmAutolinkLiteralProtocolAfter,
+ GfmAutolinkLiteralProtocolPrefixInside,
+ GfmAutolinkLiteralProtocolSlashesInside,
+
+ GfmAutolinkLiteralWwwStart,
+ GfmAutolinkLiteralWwwAfter,
+ GfmAutolinkLiteralWwwPrefixInside,
+ GfmAutolinkLiteralWwwPrefixAfter,
+
+ GfmAutolinkLiteralDomainInside,
+ GfmAutolinkLiteralDomainAtPunctuation,
+ GfmAutolinkLiteralDomainAfter,
+
+ GfmAutolinkLiteralPathInside,
+ GfmAutolinkLiteralPathAtPunctuation,
+ GfmAutolinkLiteralPathAfter,
+
+ GfmAutolinkLiteralTrail,
+ GfmAutolinkLiteralTrailCharRefInside,
+ GfmAutolinkLiteralTrailCharRefStart,
+ GfmAutolinkLiteralTrailBracketAfter,
+
GfmTableStart,
GfmTableHeadRowBefore,
GfmTableHeadRowStart,
@@ -686,6 +709,43 @@ pub fn call(tokenizer: &mut Tokenizer, name: Name) -> State {
Name::StringBefore => construct::string::before,
Name::StringBeforeData => construct::string::before_data,
+ Name::GfmAutolinkLiteralProtocolStart => construct::gfm_autolink_literal::protocol_start,
+ Name::GfmAutolinkLiteralProtocolAfter => construct::gfm_autolink_literal::protocol_after,
+ Name::GfmAutolinkLiteralProtocolPrefixInside => {
+ construct::gfm_autolink_literal::protocol_prefix_inside
+ }
+ Name::GfmAutolinkLiteralProtocolSlashesInside => {
+ construct::gfm_autolink_literal::protocol_slashes_inside
+ }
+
+ Name::GfmAutolinkLiteralWwwAfter => construct::gfm_autolink_literal::www_after,
+ Name::GfmAutolinkLiteralWwwStart => construct::gfm_autolink_literal::www_start,
+ Name::GfmAutolinkLiteralWwwPrefixInside => {
+ construct::gfm_autolink_literal::www_prefix_inside
+ }
+ Name::GfmAutolinkLiteralWwwPrefixAfter => construct::gfm_autolink_literal::www_prefix_after,
+ Name::GfmAutolinkLiteralDomainInside => construct::gfm_autolink_literal::domain_inside,
+ Name::GfmAutolinkLiteralDomainAtPunctuation => {
+ construct::gfm_autolink_literal::domain_at_punctuation
+ }
+ Name::GfmAutolinkLiteralDomainAfter => construct::gfm_autolink_literal::domain_after,
+
+ Name::GfmAutolinkLiteralPathInside => construct::gfm_autolink_literal::path_inside,
+ Name::GfmAutolinkLiteralPathAtPunctuation => {
+ construct::gfm_autolink_literal::path_at_punctuation
+ }
+ Name::GfmAutolinkLiteralPathAfter => construct::gfm_autolink_literal::path_after,
+ Name::GfmAutolinkLiteralTrail => construct::gfm_autolink_literal::trail,
+ Name::GfmAutolinkLiteralTrailCharRefStart => {
+ construct::gfm_autolink_literal::trail_char_ref_start
+ }
+ Name::GfmAutolinkLiteralTrailCharRefInside => {
+ construct::gfm_autolink_literal::trail_char_ref_inside
+ }
+ Name::GfmAutolinkLiteralTrailBracketAfter => {
+ construct::gfm_autolink_literal::trail_bracket_after
+ }
+
Name::GfmTableStart => construct::gfm_table::start,
Name::GfmTableHeadRowBefore => construct::gfm_table::head_row_before,
Name::GfmTableHeadRowStart => construct::gfm_table::head_row_start,