From 60d41672a5fb07c1ee13af90a1192894fa6fd358 Mon Sep 17 00:00:00 2001 From: Joshua Coles Date: Tue, 9 Feb 2021 10:36:39 +0000 Subject: [PATCH] Add tests for self-references Note as there is no support for block references at the moment, the generated link goes nowhere, however it is to a reasonable ID --- tests/testdata/expected/main-samples/section-ref-a.md | 7 +++++++ tests/testdata/expected/main-samples/section-ref-b.md | 2 ++ tests/testdata/input/main-samples/section-ref-a.md | 7 +++++++ tests/testdata/input/main-samples/section-ref-b.md | 2 ++ 4 files changed, 18 insertions(+) create mode 100644 tests/testdata/expected/main-samples/section-ref-a.md create mode 100644 tests/testdata/expected/main-samples/section-ref-b.md create mode 100644 tests/testdata/input/main-samples/section-ref-a.md create mode 100644 tests/testdata/input/main-samples/section-ref-b.md diff --git a/tests/testdata/expected/main-samples/section-ref-a.md b/tests/testdata/expected/main-samples/section-ref-a.md new file mode 100644 index 0000000..3552da7 --- /dev/null +++ b/tests/testdata/expected/main-samples/section-ref-a.md @@ -0,0 +1,7 @@ +[This is a header](section-ref-a.md#this-is-a-header) + +[^dda637](section-ref-a.md#dda637) + +## This is a header + +This is a block ^dda637 diff --git a/tests/testdata/expected/main-samples/section-ref-b.md b/tests/testdata/expected/main-samples/section-ref-b.md new file mode 100644 index 0000000..ee8cfae --- /dev/null +++ b/tests/testdata/expected/main-samples/section-ref-b.md @@ -0,0 +1,2 @@ +[section-ref-a > This is a header](section-ref-a.md#this-is-a-header) +[section-ref-a > ^dda637](section-ref-a.md#dda637) diff --git a/tests/testdata/input/main-samples/section-ref-a.md b/tests/testdata/input/main-samples/section-ref-a.md new file mode 100644 index 0000000..0c1840b --- /dev/null +++ b/tests/testdata/input/main-samples/section-ref-a.md @@ -0,0 +1,7 @@ +[[#This is a header]] + +[[#^dda637]] + +## This is a header + +This is a block ^dda637 \ No newline at end of file diff --git a/tests/testdata/input/main-samples/section-ref-b.md b/tests/testdata/input/main-samples/section-ref-b.md new file mode 100644 index 0000000..665c76e --- /dev/null +++ b/tests/testdata/input/main-samples/section-ref-b.md @@ -0,0 +1,2 @@ +[[section-ref-a#This is a header]] +[[section-ref-a#^dda637]]