" + html(doc, katexClient))
-open("output.tex", "w").write(tex(doc))
+open("output.tex", "w").write("\input formatitko.tex\n" + tex(doc))
#print(tex(doc))
diff --git a/formatitko.tex b/formatitko.tex
new file mode 100644
index 0000000..fbcf448
--- /dev/null
+++ b/formatitko.tex
@@ -0,0 +1,36 @@
+\input luatex85.sty
+\input ucwmac2.tex
+\ucwmodule{luaofs}
+\ucwmodule{link}
+\ucwmodule{verb}
+\parskip=3pt plus 2pt minus 1pt
+\parindent=0sp
+
+\def\strong#1{{%
+\def\emph##1{{\bi{}##1}}%
+\bf{}#1%
+}}
+\def\emph#1{{%
+\def\strong##1{{\bi{}##1}}%
+\it{}#1%
+}}
+
+\newcount\fncount
+\fncount=1
+\def\fnmark{\leavevmode\raise3pt\hbox{\fiverm\the\fncount}}
+\def\fn#1{\footnote\fnmark{#1}\advance\fncount by 1}
+
+\def\hA#1{{\parskip1em\settextsize{14}\bf #1}}
+\def\hB#1{{\parskip1em\settextsize{12}\bf #1}}
+\def\hC#1{{\parskip1em\settextsize{10}\bf #1}}
+\def\hr{{\vskip5pt\hrule\vskip5pt}}
+\long\def\blockquote#1{\vskip\lineskip\vskip\parskip\hbox{\vrule\hskip5pt\vbox{#1}}}
+\def\code#1{{\tt #1}}
+\let\codeblock\verbatim
+\def\figure#1{#1}
+\def\image#1{#1}
+\def\table#1{#1}
+\def\tablebody#1{#1}
+\def\tablerow#1{#1}
+\def\tablehead#1{#1}
+\def\tablecell#1{#1}
diff --git a/html.py b/html.py
index 8421d0b..3074d26 100644
--- a/html.py
+++ b/html.py
@@ -10,6 +10,9 @@ from katex import KatexClient
def html(e: Element, k: KatexClient, indent_level: int=0, indent_str: str="\t") -> str:
+ if hasattr(e, "attributes") and "only" in e.attributes and e.attributes["only"] != "html":
+ return ""
+
if isinstance(e, ListContainer):
return ''.join([html(child, k, indent_level, indent_str) for child in e])
@@ -191,7 +194,7 @@ def html(e: Element, k: KatexClient, indent_level: int=0, indent_str: str="\t")
return ""
if isinstance(e, Inline):
- return f"<{tag}{attributes}>{content_head}{html(e.content, k, 0, '')}{content_foot}{tag}>"
+ return f'<{tag}{attributes}>{content_head}{html(e.content, k, 0, "") if hasattr(e, "_content") else ""}{e.text if hasattr(e, "text") else ""}{content_foot}{tag}>'
out_str = ""
if not isinstance(e, Plain):
diff --git a/test-import.md b/test-import.md
index 678371b..c4f0a5c 100644
--- a/test-import.md
+++ b/test-import.md
@@ -3,5 +3,5 @@ appendChildren(element.content)
```
```python {define=opendatatask}
-println("Toto je praktická open-data úloha. V [odevzdávátku](https://ksp.mff.cuni.cz/h/odevzdavatko/) si necháte vygenerovat vstupy a odevzdáte příslušné výstupy. Záleží jen na vás, jak výstupy vyrobíte.")
+println("Toto je praktická open-data úloha. V [odevzdávátku](https://ksp.mff.cuni.cz/h/odevzdavatko/) si necháte vygenerovat vstupy a odevzdáte příslušné výstupy. Záleží jen na vás, jak výstupy vyrobíte.")
```
diff --git a/test.md b/test.md
index 931dcb3..f74b8c0 100644
--- a/test.md
+++ b/test.md
@@ -9,6 +9,11 @@ are_we_there_yet: False
This is an *example* **yay**!
+This is *very **strongly** emphasised*
+
+Příliš žluťoučký kůň pěl dábelské ódy. *Příliš žluťoučký kůň pěl dábelské ódy.* **Příliš žluťoučký kůň pěl dábelské ódy.** ***Příliš žluťoučký kůň pěl dábelské ódy.***
+
+
:::{partial=test-partial.md}
:::
@@ -33,6 +38,8 @@ def bruh(no):
wat
```
+Inline `code`
+
::::{if=cat}
This should only be shown to cats the second time
::::
@@ -41,16 +48,25 @@ This should only be shown to cats the second time
![This is a figure, go figure...](/this/image/does/not/exist.jpg)
+```python {.run}
+ctx.set_metadata("language", "cs")
+```
[!opendatatask]{}
-
+```python {.run}
+ctx.unset_metadata("language")
+```
[This too!]{if=cat}
[What]{.co}
[An inline command with contents and **bold** and another [!nop]{} inside!]{c=nop}
-[!nop]{a=b}
+[!nop]{a=b}
+> OOO a blockquote mate init
+>
+>> Nesting??
+>> Woah
A non-breakable space bro
@@ -58,7 +74,19 @@ A lot of spaces
A text with some inline math: $\sum_{i=1}^nn^2$. Plus some display math:
-
+$$
+:::
+
+
---
-This should be seen by all^[This is a footnote].
+This should be seen by all.^[This is a footnote]
| Matematicko-fyzikální fakulta University Karlovy
| Malostranské nám. 2/25
| 118 00 Praha 1
+More footnotes.^[I am a foot]
+
To Do:
- buy eggs
@@ -88,6 +121,8 @@ To Do:
2. Wooo
3. no
+4) WOO
+
``` {=html}