From 246063fb7cd21a83beae5934f95b2795fb85df51 Mon Sep 17 00:00:00 2001
From: Titus Wormer A call.^a A call.1 A paragraph. a[^b] a1 !^a !^a !^ Call.1. Call.1. Call.1. Call.1. Call.[^a+b]. Call.[^a[b]. 1. 1. 1. 1.Footnotes
@@ -41,14 +33,11 @@ fn gfm_footnote() -> Result<(), String> {
to_html_with_options(
"Noot.[^a]\n\n[^a]: dingen",
&Options {
- parse: ParseOptions {
- constructs: Constructs::gfm(),
- ..ParseOptions::default()
- },
+ parse: ParseOptions::gfm(),
compile: CompileOptions {
- gfm_footnote_label: Some("Voetnoten".into()),
- gfm_footnote_back_label: Some("Terug naar de inhoud".into()),
- ..CompileOptions::default()
+ gfm_footnote_label: Some("Voetnoten".into()),
+ gfm_footnote_back_label: Some("Terug naar de inhoud".into()),
+ ..CompileOptions::gfm()
}
}
)?,
@@ -68,13 +57,10 @@ fn gfm_footnote() -> Result<(), String> {
to_html_with_options(
"[^a]\n\n[^a]: b",
&Options {
- parse: ParseOptions {
- constructs: Constructs::gfm(),
- ..ParseOptions::default()
- },
+ parse: ParseOptions::gfm(),
compile: CompileOptions {
- gfm_footnote_label_tag_name: Some("h1".into()),
- ..CompileOptions::default()
+ gfm_footnote_label_tag_name: Some("h1".into()),
+ ..CompileOptions::gfm()
}
}
)?,
@@ -94,13 +80,10 @@ fn gfm_footnote() -> Result<(), String> {
to_html_with_options(
"[^a]\n\n[^a]: b",
&Options {
- parse: ParseOptions {
- constructs: Constructs::gfm(),
- ..ParseOptions::default()
- },
+ parse: ParseOptions::gfm(),
compile: CompileOptions {
- gfm_footnote_label_attributes: Some("class=\"footnote-heading\"".into()),
- ..CompileOptions::default()
+ gfm_footnote_label_attributes: Some("class=\"footnote-heading\"".into()),
+ ..CompileOptions::gfm()
}
}
)?,
@@ -120,13 +103,10 @@ fn gfm_footnote() -> Result<(), String> {
to_html_with_options(
"[^a]\n\n[^a]: b",
&Options {
- parse: ParseOptions {
- constructs: Constructs::gfm(),
- ..ParseOptions::default()
- },
+ parse: ParseOptions::gfm(),
compile: CompileOptions {
gfm_footnote_clobber_prefix: Some("".into()),
- ..CompileOptions::default()
+ ..CompileOptions::gfm()
}
}
)?,
@@ -143,19 +123,19 @@ fn gfm_footnote() -> Result<(), String> {
);
assert_eq!(
- to_html_with_options("A paragraph.\n\n[^a]: whatevs", &gfm)?,
+ to_html_with_options("A paragraph.\n\n[^a]: whatevs", &Options::gfm())?,
"
Footnotes
@@ -169,7 +149,7 @@ fn gfm_footnote() -> Result<(), String> {
);
assert_eq!(
- to_html_with_options("a[^b], c[^b]\n\n[^b]: d", &gfm)?,
+ to_html_with_options("a[^b], c[^b]\n\n[^b]: d", &Options::gfm())?,
"
Footnotes
@@ -183,32 +163,32 @@ fn gfm_footnote() -> Result<(), String> {
);
assert_eq!(
- to_html_with_options("![^a](b)", &gfm)?,
+ to_html_with_options("![^a](b)", &Options::gfm())?,
"
Footnotes
@@ -222,7 +202,7 @@ fn gfm_footnote() -> Result<(), String> {
);
assert_eq!(
- to_html_with_options("Call.[^a©b].\n\n[^a©b]: y", &gfm)?,
+ to_html_with_options("Call.[^a©b].\n\n[^a©b]: y", &Options::gfm())?,
"
Footnotes
@@ -238,7 +218,7 @@ fn gfm_footnote() -> Result<(), String> {
//
Footnotes
@@ -252,7 +232,7 @@ fn gfm_footnote() -> Result<(), String> {
);
assert_eq!(
- to_html_with_options("Call.[^a[b].\n\n[^a[b]: y", &gfm)?,
+ to_html_with_options("Call.[^a[b].\n\n[^a[b]: y", &Options::gfm())?,
"
Footnotes
@@ -266,19 +246,19 @@ fn gfm_footnote() -> Result<(), String> {
);
assert_eq!(
- to_html_with_options("Call.[^a\\+b].\n\n[^a+b]: y", &gfm)?,
+ to_html_with_options("Call.[^a\\+b].\n\n[^a+b]: y", &Options::gfm())?,
"
Footnotes
@@ -293,7 +273,7 @@ b [^1]: a\nb", &gfm)?,
+ to_html_with_options("[^1].\n\n> [^1]: a\nb", &Options::gfm())?,
"
@@ -310,7 +290,7 @@ b [^1]: a\n> b", &gfm)?,
+ to_html_with_options("[^1].\n\n> [^1]: a\n> b", &Options::gfm())?,
"
@@ -327,7 +307,7 @@ b b", &gfm)?,
+ to_html_with_options("[^1].\n\n[^1]: a\n\n > b", &Options::gfm())?,
"Footnotes
[^a{}]: y
", max, max), "should not support 1000 characters in a call / definition" @@ -373,7 +353,7 @@ b 1a a!i @@ -419,7 +399,7 @@ a!a![^1]
", "should match bang/caret interplay (undefined) like GitHub" ); @@ -430,7 +410,7 @@ a!a!1Calls may not be empty: ^.
Calls cannot contain whitespace only: ^ .
@@ -527,7 +507,7 @@ Some calls.[^ w][^x ][^y][^z] [^x ]: # z "###, - &gfm + &Options::gfm() )?, r###"[^c d]: # e
[^f g]: # h
@@ -595,7 +575,7 @@ j], [^ l], [^m ] [^![image](#)]: a "###, - &gfm + &Options::gfm() )?, // Note: // * GH does not support colons. @@ -654,7 +634,7 @@ j], [^ l], [^m ] More. [^4]: Directly after a list item. "###, - &gfm + &Options::gfm() )?, r###"@@ -711,7 +691,7 @@ j], [^ l], [^m ] - list "###, - &gfm + &Options::gfm() )?, r###"Heading
@@ -768,7 +748,7 @@ Lazy? Lazy! "###, - &gfm + &Options::gfm() )?, r###"Lazy?
@@ -824,7 +804,7 @@ Lazy! [^10]:- - - kilo "###, - &gfm + &Options::gfm() )?, r###"Footnotes
@@ -897,7 +877,7 @@ indented delta Call11Footnotes
@@ -919,7 +899,7 @@ indented delta Call1Footnotes
@@ -961,7 +941,7 @@ indented delta emphasis1strong2
@@ -998,7 +978,7 @@ indented delta What are these!1, !2[], and ![this]3.Footnotes
@@ -1040,7 +1020,7 @@ indented delta 123456Heading
@@ -1093,7 +1073,7 @@ indented delta What are these1, 2[], and [this]3.Footnotes
@@ -1143,7 +1123,7 @@ indented delta 1234Heading
@@ -1205,7 +1185,7 @@ indented delta 1234Footnotes
@@ -1254,7 +1234,7 @@ more code [^3]: [^4]: Paragraph "###, - &gfm + &Options::gfm() )?, r###"@@ -1304,7 +1284,7 @@ more code - list "###, - &gfm + &Options::gfm() )?, r###"
Heading
@@ -1358,7 +1338,7 @@ more code - list "###, - &gfm + &Options::gfm() )?, r###"Footnotes
@@ -1416,7 +1396,7 @@ belong to the previous footnote. This paragraph won’t be part of the note, because it isn’t indented. "###, - &gfm + &Options::gfm() )?, r###"Here is a footnote reference,1 and another.2
This paragraph won’t be part of the note, because it @@ -1484,7 +1464,7 @@ multi-paragraph list items. Call[^1][^2]12345678910.
[^1]: 5 @@ -1576,7 +1556,7 @@ multi-paragraph list items. Call123456789.
3
@@ -1635,7 +1615,7 @@ multi-paragraph list items. Here is a short reference,1, a collapsed one,2, and a full one. "###, @@ -1643,7 +1623,7 @@ multi-paragraph list items.