diff --git a/README.tlm b/README.tlm
index e029ddc..1b16d29 100644
--- a/README.tlm
+++ b/README.tlm
@@ -49,5 +49,8 @@ main :: proc() {
---
+H_2_O_4_U is uranium peroxide
+Here is some __underlined__ text
+
[&1] Ordered list item 2 not included
[&named] This is the definition for a named footnote
diff --git a/src/html.odin b/src/html.odin
index 42196de..55b4aa4 100644
--- a/src/html.odin
+++ b/src/html.odin
@@ -213,6 +213,27 @@ print_html :: proc(token: ^Token) {
case TokenType.HorizontalRule:
fmt.print("
\n")
+ case TokenType.Underline:
+ fmt.print("")
+ for child in token.children {
+ print_html(child)
+ }
+ fmt.print("")
+
+ case TokenType.Superscript:
+ fmt.print("")
+ for child in token.children {
+ print_html(child)
+ }
+ fmt.print("")
+
+ case TokenType.Subscript:
+ fmt.print("")
+ for child in token.children {
+ print_html(child)
+ }
+ fmt.print("")
+
case TokenType.BreakLine:
fmt.print("
\n")
diff --git a/src/main.odin b/src/main.odin
index 8c8b20e..b032076 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -65,6 +65,12 @@ print_token :: proc(token: ^Token, depth: int = 0) {
type_str = "InlineCode"
case TokenType.HorizontalRule:
type_str = "HorizontalRule"
+ case TokenType.Underline:
+ type_str = "Underline"
+ case TokenType.Superscript:
+ type_str = "Superscript"
+ case TokenType.Subscript:
+ type_str = "Subscript"
}
value_str := ""
diff --git a/src/parser.odin b/src/parser.odin
index 569495b..cbb62d1 100644
--- a/src/parser.odin
+++ b/src/parser.odin
@@ -29,6 +29,9 @@ TokenType :: enum {
CodeBlock,
InlineCode,
HorizontalRule,
+ Underline,
+ Superscript,
+ Subscript,
}
TokenValue :: union {
@@ -258,6 +261,8 @@ pass_through_children :: proc(token: ^Token) {
parse_inline_style(token, '*', []StyleToggle{{2, .Bold}, {1, .Italics}})
parse_inline_style(token, '~', []StyleToggle{{2, .Strikethrough}})
parse_inline_style(token, '-', []StyleToggle{{2, .Strikethrough}})
+ parse_inline_style(token, '^', []StyleToggle{{1, .Superscript}})
+ parse_inline_style(token, '_', []StyleToggle{{2, .Underline}, {1, .Subscript}})
}
parse_inline_code :: proc(token: ^Token) {