use super::*; #[test] fn basic_inline_footnote() { html_opts!( [extension.footnotes, extension.inline_footnotes], "Here is an inline footnote^[This is the footnote content].\n", concat!( "

Here is an inline footnote1.

\n", "
\n", "
    \n", "
  1. \n", "

    This is the footnote content ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn inline_footnote_with_emphasis() { html_opts!( [extension.footnotes, extension.inline_footnotes], "Text^[With *emphasis* and **strong**].\n", concat!( "

Text1.

\n", "
\n", "
    \n", "
  1. \n", "

    With emphasis and strong ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn inline_footnote_with_link() { html_opts!( [extension.footnotes, extension.inline_footnotes], "Text^[See [example](https://example.com)].\n", concat!( "

Text1.

\n", "
\n", "
    \n", "
  1. \n", "

    See example ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn multiple_inline_footnotes() { html_opts!( [extension.footnotes, extension.inline_footnotes], "First^[First note] and second^[Second note].\n", concat!( "

First1 ", "and second2.

\n", "
\n", "
    \n", "
  1. \n", "

    First note ↩

    \n", "
  2. \n", "
  3. \n", "

    Second note ↩

    \n", "
  4. \n", "
\n", "
\n" ), ); } #[test] fn mixed_inline_and_regular_footnotes() { html_opts!( [extension.footnotes, extension.inline_footnotes], concat!( "Regular[^1] and inline^[Inline note] and another regular[^2].\n", "\n", "[^1]: First regular footnote.\n", "[^2]: Second regular footnote.\n" ), concat!( "

Regular1 ", "and inline2 ", "and another regular3.

\n", "
\n", "
    \n", "
  1. \n", "

    First regular footnote. ↩

    \n", "
  2. \n", "
  3. \n", "

    Inline note ↩

    \n", "
  4. \n", "
  5. \n", "

    Second regular footnote. ↩

    \n", "
  6. \n", "
\n", "
\n" ), ); } #[test] fn empty_inline_footnote_not_parsed() { html_opts!( [extension.footnotes, extension.inline_footnotes], "Text^[] should not parse.\n", "

Text^[] should not parse.

\n", ); } #[test] fn whitespace_only_inline_footnote_not_parsed() { html_opts!( [extension.footnotes, extension.inline_footnotes], "Text^[\t\r]more.\n", "

Text^[\n]more.

\n", ); html_opts!( [extension.footnotes, extension.inline_footnotes], "Text^[ ]more.\n", "

Text^[ ]more.

\n", ); html_opts!( [extension.footnotes, extension.inline_footnotes], "Text^[\t\n]more.\n", "

Text^[\n]more.

\n", ); } #[test] fn inline_footnote_without_footnotes_enabled() { html_opts!( [extension.inline_footnotes], "Text^[note] should not parse.\n", "

Text^[note] should not parse.

\n", ); } #[test] fn inline_footnote_with_code() { html_opts!( [extension.footnotes, extension.inline_footnotes], "Text^[With `code` inline].\n", concat!( "

Text1.

\n", "
\n", "
    \n", "
  1. \n", "

    With code inline ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn inline_footnote_multiline() { html_opts!( [extension.footnotes, extension.inline_footnotes], concat!( "Here is an inline note.^[Inline notes are easier to write, since\n", "you don't have to pick an identifier and move down to type the\n", "note.]\n" ), concat!( "

Here is an inline note.1

\n", "
\n", "
    \n", "
  1. \n", "

    Inline notes are easier to write, since\n", "you don't have to pick an identifier and move down to type the\n", "note. ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn escaped_caret_not_parsed() { html_opts!( [extension.footnotes, extension.inline_footnotes], r"Escaped: \^[not a note]. Real: ^[yes]. ", concat!( "

Escaped: ^[not a note]. Real: 1.

\n", "
\n", "
    \n", "
  1. \n", "

    yes ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn whitespace_between_caret_and_bracket() { html_opts!( [extension.footnotes, extension.inline_footnotes], "Text^ [not a note].\n", "

Text^ [not a note].

\n", ); } #[test] fn escaped_bracket_inside_body() { html_opts!( [extension.footnotes, extension.inline_footnotes], r"A ^[square bracket \] inside]. ", concat!( "

A 1.

\n", "
\n", "
    \n", "
  1. \n", "

    square bracket ] inside ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn caret_in_other_contexts() { html_opts!( [extension.footnotes, extension.inline_footnotes], "2^32 is big. ^[note].\n", concat!( "

2^32 is big. 1.

\n", "
\n", "
    \n", "
  1. \n", "

    note ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn inline_code_protects_marker() { html_opts!( [extension.footnotes, extension.inline_footnotes], "`^[nope]` and yes ^[ok].\n", concat!( "

^[nope] and yes 1.

\n", "
\n", "
    \n", "
  1. \n", "

    ok ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn back_to_back_inline_footnotes() { html_opts!( [extension.footnotes, extension.inline_footnotes], "A^[one]^[two].\n", concat!( "

A1", "2.

\n", "
\n", "
    \n", "
  1. \n", "

    one ↩

    \n", "
  2. \n", "
  3. \n", "

    two ↩

    \n", "
  4. \n", "
\n", "
\n" ), ); } #[test] fn no_surrounding_spaces() { html_opts!( [extension.footnotes, extension.inline_footnotes], "word^[tight]word\n", concat!( "

word1word

\n", "
\n", "
    \n", "
  1. \n", "

    tight ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn at_paragraph_start() { html_opts!( [extension.footnotes, extension.inline_footnotes], "^[start] begins.\n", concat!( "

1 begins.

\n", "
\n", "
    \n", "
  1. \n", "

    start ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn at_paragraph_end() { html_opts!( [extension.footnotes, extension.inline_footnotes], "ends here ^[fin]\n", concat!( "

ends here 1

\n", "
\n", "
    \n", "
  1. \n", "

    fin ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn inside_emphasis() { html_opts!( [extension.footnotes, extension.inline_footnotes], "*emph ^[note] text*\n", concat!( "

emph 1 text

\n", "
\n", "
    \n", "
  1. \n", "

    note ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn nested_inline_footnote_supported() { html_opts!( [extension.footnotes, extension.inline_footnotes], "A ^[outer and ^[inner] literal].\n", concat!( "

A 1.

\n", "
\n", "
    \n", "
  1. \n", "

    outer and 2 literal ↩

    \n", "
  2. \n", "
  3. \n", "

    inner ↩

    \n", "
  4. \n", "
\n", "
\n" ), ); } #[test] fn with_image() { html_opts!( [extension.footnotes, extension.inline_footnotes], "X ^[see ![alt](img.png)].\n", concat!( "

X 1.

\n", "
\n", "
    \n", "
  1. \n", "

    see \"alt\" ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn with_unicode_and_emoji() { html_opts!( [extension.footnotes, extension.inline_footnotes], "X ^[π ≈ 3.14159 😊].\n", concat!( "

X 1.

\n", "
\n", "
    \n", "
  1. \n", "

    π ≈ 3.14159 😊 ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn in_list_item() { html_opts!( [extension.footnotes, extension.inline_footnotes], "- a ^[note]\n- b\n", concat!( "\n", "
\n", "
    \n", "
  1. \n", "

    note ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn in_blockquote() { html_opts!( [extension.footnotes, extension.inline_footnotes], "> quote ^[q].\n", concat!( "
\n", "

quote 1.

\n", "
\n", "
\n", "
    \n", "
  1. \n", "

    q ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn in_heading() { html_opts!( [extension.footnotes, extension.inline_footnotes], "# H ^[note]\n", concat!( "

H 1

\n", "
\n", "
    \n", "
  1. \n", "

    note ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); } #[test] fn in_table_cell() { html_opts!( [ extension.footnotes, extension.inline_footnotes, extension.table ], "| H |\n| - |\n| c ^[cell] |\n", concat!( "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
H
c 1
\n", "
\n", "
    \n", "
  1. \n", "

    cell ↩

    \n", "
  2. \n", "
\n", "
\n" ), ); }