go-org-orgwiki/org/testdata/blocks.html
Niklas Fasching 97fe8b7850 html: Fix code block export (superfluous newlines)
I didn't consider that all newlines in the pre block will be printed and we
thus shouldn't wrap html that has it's tags on separate lines (i.e. contains
superfluous newlines) - wrapping in a div less accurately represents
org-html-export but it provides the same information and gives us more freedom
in the return value of HighlightCodeBlock as well as allowing us to keep the
html tags on new lines (consistency).
2019-07-28 16:40:09 +02:00

144 lines
2 KiB
HTML

<figure>
<div class="src src-bash">
<div class="highlight">
<pre>
echo &#34;a bash source block&#34;
function hello {
echo Hello World!
}
hello
</pre>
</div>
</div>
<figcaption>
block caption
</figcaption>
</figure>
<div class="src src-text">
<div class="highlight">
<pre>
a source block without a language
</pre>
</div>
</div>
<pre class="example">
an example block with
multiple lines including
empty lines!
it also has multiple parameters
src, example & export blocks treat their content as raw text
/inline/ *markup* is ignored
and whitespace is honored and not removed
</pre>
<pre class="example">
examples like this
are also supported
note that /inline/ *markup* ignored
</pre>
<blockquote>
<p>
Mongodb is <strong>webscale</strong>. (source: <a href="http://www.mongodb-is-web-scale.com/">mongodb-is-web-scale</a>)
</p>
<p>
blocks like the quote block parse their content and can contain
</p>
<ul>
<li>
<p>
lists
</p>
</li>
<li>
<p>
inline <em>markup</em>
</p>
</li>
<li>
<p>
tables
</p>
<table>
<tbody>
<tr>
<td>foo</td>
</tr>
<tr>
<td>bar</td>
</tr>
<tr>
<td>baz</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>
paragraphs
</p>
</li>
<li>
<p>
</p>
</li>
</ul>
<p>
also whitespace is not significant
and superfluous whitespace (at the beginning of the line) is removed
</p>
</blockquote>
<script>
console.log("Hello World!")
</script>
<ul>
<li>
<p>
list item 1
blocks can contain unindented lines that would normally end a list item
</p>
<pre class="example">
this line is not indented - if it was outside of a block the list item would end
</pre>
<blockquote>
<p>
this line is not indented - if it was outside of a block the list item would end
</p>
</blockquote>
<p>
now we&#39;re outside the block again and the following unindented line will be outside of the list item
</p>
</li>
</ul>
<p>
this unindented line is outside of the list item
</p>
<ul>
<li>
<p>
list item 2
</p>
<div class="src src-text">
<div class="highlight">
<pre>
#+BEGIN_EXAMPLE
</pre>
</div>
</div>
<p>
#+END_EXAMPLE
</p>
<p>
#+BEGIN_QUOTE
</p>
<pre class="example">
#+END_QUOTE
</pre>
</li>
</ul>