Summary Files Commits Branches @commit @diff @stats
path: root / single.awk
diff options
context:
space:
mode:
1 files changed, 27 insertions, 1 deletions
-rw-r--r--single.awk28
diff --git a/single.awk b/single.awk
index 37f9d3a..316981b 100644
--- a/single.awk
+++ b/single.awk
@@ -11,7 +11,7 @@
# [x] Horizontal rules
# [ ] Span elements
# [ ] Links
-# [ ] Emphasis
+# [x] Emphasis
# [ ] Code
# [ ] Images
# [ ] Other
@@ -108,6 +108,32 @@ blankline {
gsub(/</, "\\&lt;")
}
+# Emphasis
+/__.+__/ {
+ while (match($0, /__/)) {
+ sub(/__/, "<strong>")
+ sub(/__/, "</strong>")
+ }
+}
+/\*\*.+\*\*/ {
+ while (match($0, /\*\*/)) {
+ sub(/\*\*/, "<strong>")
+ sub(/\*\*/, "</strong>")
+ }
+}
+/_[^_].+_/ {
+ while (match($0, /_/)) {
+ sub(/_/, "<em>")
+ sub(/_/, "</em>")
+ }
+}
+/\*[^_].+\*/ {
+ while (match($0, /\*/)) {
+ sub(/\*/, "<em>")
+ sub(/\*/, "</em>")
+ }
+}
+
{ print }
END {