From b0e89cab89f93fd5c1edba5c7e0b775c1a9eff4c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 21 Jul 2024 09:39:34 +0300 Subject: (single) Roughly implemented emphasis --- single.awk | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'single.awk') 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(/") + sub(/__/, "") + } +} +/\*\*.+\*\*/ { + while (match($0, /\*\*/)) { + sub(/\*\*/, "") + sub(/\*\*/, "") + } +} +/_[^_].+_/ { + while (match($0, /_/)) { + sub(/_/, "") + sub(/_/, "") + } +} +/\*[^_].+\*/ { + while (match($0, /\*/)) { + sub(/\*/, "") + sub(/\*/, "") + } +} + { print } END { -- cgit v1.3.1-23-gd82d