aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-11-21 01:20:03 +0700
committerShulhan <ms@kilabit.info>2022-11-27 21:14:18 +0700
commit5c7bfc04dc3d2cd60e84c80229804fdcd615709e (patch)
tree63b9749699090421b55355d0f3e1f5c1b99875a1 /testdata
parent3d1caba74842d7dd0800cd0351ddb4c47364a541 (diff)
downloadasciidoctor-go-5c7bfc04dc3d2cd60e84c80229804fdcd615709e.tar.xz
all: implement inline macro for passthrough ("pass:")
The inline passthrough "pass:" can be used to control the substitutions applied to a run of text. Ref: https://docs.asciidoctor.org/asciidoc/latest/pass/pass-macro/
Diffstat (limited to 'testdata')
-rw-r--r--testdata/inline_parser/macro_pass_a_test.txt13
-rw-r--r--testdata/inline_parser/macro_pass_c_test.txt16
-rw-r--r--testdata/inline_parser/macro_pass_m_test.txt32
-rw-r--r--testdata/inline_parser/macro_pass_none_test.txt29
-rw-r--r--testdata/inline_parser/macro_pass_q_test.txt15
-rw-r--r--testdata/inline_parser/macro_pass_r_test.txt18
6 files changed, 123 insertions, 0 deletions
diff --git a/testdata/inline_parser/macro_pass_a_test.txt b/testdata/inline_parser/macro_pass_a_test.txt
new file mode 100644
index 0000000..3c4dd8c
--- /dev/null
+++ b/testdata/inline_parser/macro_pass_a_test.txt
@@ -0,0 +1,13 @@
+Test macro pass with attribute substitutions only.
+
+>>> pass_a.adoc
+:meta-a: meta A
+:meta-b: meta B
+
+pass:a[attributes: {meta-A}, {meta-b}, and {meta-not_exist}].
+
+<<< pass_a.html
+
+<div class="paragraph">
+<p>attributes: meta A, meta B, and {meta-not_exist}.</p>
+</div>
diff --git a/testdata/inline_parser/macro_pass_c_test.txt b/testdata/inline_parser/macro_pass_c_test.txt
new file mode 100644
index 0000000..c5682fe
--- /dev/null
+++ b/testdata/inline_parser/macro_pass_c_test.txt
@@ -0,0 +1,16 @@
+Test macro pass with special character substitutions only.
+
+>>> pass_c.adoc
+
+pass:c[char: < > &].
+
+pass:c[replacement: (C) (R) (TM) -- ... -> => <- <= user's input].
+
+<<< pass_c.html
+
+<div class="paragraph">
+<p>char: &lt; &gt; &amp;.</p>
+</div>
+<div class="paragraph">
+<p>replacement: (C) (R) (TM) -- ... -&gt; =&gt; &lt;- &lt;= user's input.</p>
+</div>
diff --git a/testdata/inline_parser/macro_pass_m_test.txt b/testdata/inline_parser/macro_pass_m_test.txt
new file mode 100644
index 0000000..248680e
--- /dev/null
+++ b/testdata/inline_parser/macro_pass_m_test.txt
@@ -0,0 +1,32 @@
+Test macro pass with macro only.
+
+>>> pass_m.adoc
+
+pass:m[Text with footnote:id[footnote]].
+
+pass:m[Text with http://127.0.0.1[HTTP URL]].
+
+pass:m[Text with image:test.jpg[image]].
+
+pass:m[Text with pass:[_none_] and pass:c[<_char_>]].
+
+<<< pass_m.html
+
+<div class="paragraph">
+<p>Text with <sup class="footnote" id="_footnote_id">[<a id="_footnoteref_1" class="footnote" href="#_footnotedef_1" title="View footnote.">1</a>]</sup>.</p>
+</div>
+<div class="paragraph">
+<p>Text with <a href="http://127.0.0.1">HTTP URL</a>.</p>
+</div>
+<div class="paragraph">
+<p>Text with <span class="image"><img src="test.jpg" alt="image"></span>.</p>
+</div>
+<div class="paragraph">
+<p>Text with pass:[_none_] and pass:c[<_char_>].</p>
+</div>
+<div id="footnotes">
+<hr>
+<div class="footnote" id="_footnotedef_1">
+<a href="#_footnoteref_1">1</a>. footnote
+</div>
+</div>
diff --git a/testdata/inline_parser/macro_pass_none_test.txt b/testdata/inline_parser/macro_pass_none_test.txt
new file mode 100644
index 0000000..e4c1013
--- /dev/null
+++ b/testdata/inline_parser/macro_pass_none_test.txt
@@ -0,0 +1,29 @@
+
+>>> pass_none.adoc
+
+pass:[char: < > &].
+
+pass:[quote: _emphasis_, *strong*],
+pass:[`monospace`, ^superscript^, ~subscript~],
+pass:["`double curved quotes`", and '`single curved quotes`'].
+
+pass:[attributes: {meta-A}, {meta-b}, and {meta-not_exist}].
+
+pass:[replacement: (C) (R) (TM) -- ... -> => <- <= user's input].
+
+<<< pass_none.html
+
+<div class="paragraph">
+<p>char: < > &.</p>
+</div>
+<div class="paragraph">
+<p>quote: _emphasis_, *strong*,
+`monospace`, ^superscript^, ~subscript~,
+"`double curved quotes`", and '`single curved quotes`'.</p>
+</div>
+<div class="paragraph">
+<p>attributes: {meta-A}, {meta-b}, and {meta-not_exist}.</p>
+</div>
+<div class="paragraph">
+<p>replacement: (C) (R) (TM) -- ... -> => <- <= user's input.</p>
+</div>
diff --git a/testdata/inline_parser/macro_pass_q_test.txt b/testdata/inline_parser/macro_pass_q_test.txt
new file mode 100644
index 0000000..067ce43
--- /dev/null
+++ b/testdata/inline_parser/macro_pass_q_test.txt
@@ -0,0 +1,15 @@
+Test macro pass with inline markup substitutions only.
+
+>>> pass_q.adoc
+
+pass:q[quote: _emphasis_, *strong*],
+pass:q[`monospace`, ^superscript^, ~subscript~],
+pass:q["`double curved quotes`", and '`single curved quotes`'].
+
+<<< pass_q.html
+
+<div class="paragraph">
+<p>quote: <em>emphasis</em>, <strong>strong</strong>,
+<code>monospace</code>, <sup>superscript</sup>, <sub>subscript</sub>,
+&#8220;double curved quotes&#8221;, and &#8216;single curved quotes&#8217;.</p>
+</div>
diff --git a/testdata/inline_parser/macro_pass_r_test.txt b/testdata/inline_parser/macro_pass_r_test.txt
new file mode 100644
index 0000000..e777b73
--- /dev/null
+++ b/testdata/inline_parser/macro_pass_r_test.txt
@@ -0,0 +1,18 @@
+Test macro pass with special replacements only.
+
+>>> pass_r.adoc
+
+pass:r[char: < > &].
+
+pass:r[replacement: (C) (R) (TM) -- ...]
+pass:r[-> => <- <= user's input].
+
+<<< pass_r.html
+
+<div class="paragraph">
+<p>char: < > &.</p>
+</div>
+<div class="paragraph">
+<p>replacement: &#169; &#174; &#8482;&#8201;&#8212;&#8201;&#8230;
+&#8594; &#8658; &#8592; &#8656; user&#8217;s input.</p>
+</div>