aboutsummaryrefslogtreecommitdiff
path: root/test/command/4186.md
diff options
context:
space:
mode:
authorBrian Leung <29217594+leungbk@users.noreply.github.com>2019-09-09 07:34:10 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-08 22:34:10 -0700
commit0558ea9836f5350a00f3df19d55ca6bddda1947b (patch)
tree980f9a68ad879f513f256e9cf22b5c7c7d0ecea5 /test/command/4186.md
parent8f5ab975695b77d92f5bd6b0faeb0ccaf7e019a5 (diff)
downloadpandoc-0558ea9836f5350a00f3df19d55ca6bddda1947b.tar.gz
Org reader: modify handling of example blocks. (#5717)
* Org reader: allow the `-i` switch to ignore leading spaces. * Org reader: handle awkwardly-aligned code blocks within lists. Code blocks in Org lists must have their #+BEGIN_ aligned in a reasonable way, but their other components can be positioned otherwise.
Diffstat (limited to 'test/command/4186.md')
-rw-r--r--test/command/4186.md60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/command/4186.md b/test/command/4186.md
new file mode 100644
index 000000000..2345b0350
--- /dev/null
+++ b/test/command/4186.md
@@ -0,0 +1,60 @@
+```
+% pandoc -f org -t native
+#+BEGIN_EXAMPLE -i
+ This should retain the four leading spaces
+#+END_EXAMPLE
+^D
+[CodeBlock ("",["example"],[]) " This should retain the four leading spaces\n"]
+```
+
+```
+% pandoc -f org -t html
+- depth 1
+ #+NAME: bob
+ #+BEGIN_EXAMPLE -i
+ Vertical alignment is four spaces beyond the appearance of the word "depth".
+ #+END_EXAMPLE
+ - depth 2
+ #+begin_example
+ Vertically aligned with the second appearance of the word "depth".
+ #+end_example
+ #+begin_example -i
+ Vertical alignment is four spaces beyond the second
+ appearance of the word "depth".
+ The "begin" portion is a component of
+ this deeper list element, so that guarantees
+ that the entire block must be a component of the
+ inner list element.
+ #+end_example
+ Still inside the inner list element
+ #+NAME: carrie
+ #+BEGIN_EXAMPLE
+ This belongs to the outer list element, and is aligned accordingly, since the NAME attribute is not indented deeply enough. It is not enough for the BEGIN alone to be aligned deeply if the block is meant to have a NAME.
+ #+END_EXAMPLE
+ Still in the shallower list element since the preceding example
+ block forced the deeper list element to terminate.
+Outside all lists.
+^D
+<ul>
+<li><p>depth 1</p>
+<pre id="bob" class="example"><code> Vertical alignment is four spaces beyond the appearance of the word &quot;depth&quot;.
+</code></pre>
+<ul>
+<li><p>depth 2</p>
+<pre class="example"><code>Vertically aligned with the second appearance of the word &quot;depth&quot;.
+</code></pre>
+<pre class="example"><code> Vertical alignment is four spaces beyond the second
+ appearance of the word &quot;depth&quot;.
+ The &quot;begin&quot; portion is a component of
+ this deeper list element, so that guarantees
+ that the entire block must be a component of the
+ inner list element.
+</code></pre>
+<p>Still inside the inner list element</p></li>
+</ul>
+<pre id="carrie" class="example"><code>This belongs to the outer list element, and is aligned accordingly, since the NAME attribute is not indented deeply enough. It is not enough for the BEGIN alone to be aligned deeply if the block is meant to have a NAME.
+</code></pre>
+<p>Still in the shallower list element since the preceding example block forced the deeper list element to terminate.</p></li>
+</ul>
+<p>Outside all lists.</p>
+```