line->type = (first_child->type - HASH1) + LINE_ATX_1;
first_child->type = (line->type - LINE_ATX_1) + MARKER_H1;
- // Strip trailing whitespace from '#' sequence
- first_child->len = first_child->type - MARKER_H1 + 1;
-
// Strip trailing '#' sequence if present
if (line->child->tail->type == TEXT_NL) {
if ((line->child->tail->prev->type >= HASH1) &&
print_const(""");
break;
+ case MARKER_H1:
+ case MARKER_H2:
+ case MARKER_H3:
+ case MARKER_H4:
+ case MARKER_H5:
+ case MARKER_H6:
+ temp = (char *) &source[t->start];
+ while (temp) {
+ switch (*temp) {
+ case '#':
+ print_const("#");
+ temp++;
+ break;
+ case ' ':
+ print_const(" ");
+ temp++;
+ break;
+ case '\t':
+ print_const("<text:tab/>");
+ temp++;
+ break;
+ default:
+ temp = NULL;
+ break;
+ }
+ }
+ break;
+
case MARKER_LIST_BULLET:
case MARKER_LIST_ENUMERATOR:
print_token(t);
case TEXT_EMPTY:
break;
+ case TEXT_LINEBREAK:
+ print_const(" ");
case TEXT_NL:
print_const("<text:line-break/>");
break;
--- /dev/null
+Fletcher Penney,fletcher,minime.private,02.05.2018 19:53,file:///Users/fletcher/Library/Application%20Support/LibreOffice/4;
\ No newline at end of file
<text:p text:style-name="Preformatted Text">* foo<text:line-break/>+ bar<text:line-break/>- baz<text:line-break/>* foo<text:line-break/>+ bar<text:line-break/>- baz<text:line-break/><text:line-break/>1. foo<text:line-break/>2. bar<text:line-break/>3. baz<text:line-break/></text:p>
+<text:p text:style-name="Preformatted Text"># foo<text:line-break/>##<text:tab/>bar<text:line-break/>### baz #<text:line-break/>####<text:tab/>foo<text:tab/>## <text:line-break/>#####<text:tab/><text:tab/>bar<text:tab/><text:tab/>##<text:tab/><text:line-break/>###### baz#<text:line-break/></text:p>
+
<text:p text:style-name="Preformatted Text">foo<text:line-break/></text:p>
</office:text>
</office:body>
3. baz
</code></pre>
+<pre><code># foo
+## bar
+### baz #
+#### foo ##
+##### bar ##
+###### baz#
+</code></pre>
+
<pre><code>foo
</code></pre>
```</li>
</ol>
+<p>```</p>
+
+<h1>foo</h1>
+
+<h2>bar</h2>
+
+<h3>baz </h3>
+
+<h4>foo ##</h4>
+
+<h5>bar ## </h5>
+
+<h6>baz</h6>
+
+<p>```</p>
+
<p>```
foo</p>
3. baz
\end{verbatim}
+\begin{verbatim}
+# foo
+## bar
+### baz #
+#### foo ##
+##### bar ##
+###### baz#
+\end{verbatim}
+
\begin{verbatim}
foo
\end{verbatim}
3. baz
```
+```
+# foo
+## bar
+### baz #
+#### foo ##
+##### bar ##
+###### baz#
+```
```
foo
<text:p text:style-name="Standard">If you’re referring to a local resource on the same server, you can
use relative paths:</text:p>
-<text:p text:style-name="Preformatted Text">See my [About](/about/) page for details.
-</text:p>
+<text:p text:style-name="Preformatted Text">See my [About](/about/) page for details. <text:line-break/></text:p>
<text:p text:style-name="Standard">Reference-style links use a second set of square brackets, inside
which you place a label of your choosing to identify the link:</text:p>