Summary Files Commits Branches @commit @diff @stats
path: root / single.awk
diff options
context:
space:
mode:
Commit80aac3ffed20cbb3514ac81ccacb91c14871ce01 (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-07-21 10:51:30 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-07-21 10:51:30 +0300
Files514132c7da6e9835acb19f1fd4898514d0446e0a /single.awk
csg-80aac3ffed20cbb3514ac81ccacb91c14871ce01.tar
csg-80aac3ffed20cbb3514ac81ccacb91c14871ce01.tar.gz
csg-80aac3ffed20cbb3514ac81ccacb91c14871ce01.zip
Parentb0e89cab89f93fd5c1edba5c7e0b775c1a9eff4c (diff)
(single) Added line breaks and updated documentation with some non-standard features
1 files changed, 17 insertions, 2 deletions
-rw-r--r--single.awk19
diff --git a/single.awk b/single.awk
index 316981b..6d9e80e 100644
--- a/single.awk
+++ b/single.awk
@@ -3,7 +3,7 @@
# [x] Autoescape
# [ ] Block elements
# [x] Paragraph
-# [ ] Line break
+# [x] Line break
# [.] Headers (atx and setex)
# [x] Blockquotes
# [ ] Lists
@@ -17,6 +17,16 @@
# [ ] Other
# [ ] Autolinks
# [ ] Escapes
+#
+# [ ] Non-standard features
+# [ ] Strikethrough ~~...~~
+# [ ] Superscript ^^...^^
+# [ ] Subscript ~...~
+# [ ] Footnote [^...] (with user customizations)
+# [ ] Task list - [ ]
+# [ ] Definition lists
+# [ ] Fenced code blocks ```lang ```
+# [ ] Table alignment
BEGIN {
prev_blankline = blankline = 1
@@ -57,12 +67,17 @@ BEGIN {
}
# Horizontal rules
-/^(-|\*|_) ?(-|\*|_) ?(-|\*|_)+$/ {
+/^(-|\*|_) ?(-|\*|_) ?(-|\*|_|[[:blank:]])+$/ {
print "<hr>"
blankline = 1
next
}
+# Line break
+/ $/ {
+ sub(/ $/, "</br>")
+}
+
# atx-style headers
/^[[:blank:]]*#+/ {
match($0, /#+/)