From 849013a6d2ae99ea1b088298b8f2067818b7404d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 May 2022 17:16:49 -0500 Subject: Generate a feed --- ht.awk | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ht.awk') diff --git a/ht.awk b/ht.awk index 5328361..faa729d 100755 --- a/ht.awk +++ b/ht.awk @@ -15,6 +15,7 @@ function buflush() { } function esc(t) { + # This is of much more limited utility than I initially realized. gsub(/&/, "\\&", t); gsub(//, "\\>", t); @@ -30,8 +31,8 @@ function esc(t) { } /^=>/ { # Links (Gemini-style) - link = "" esc($3); - for (i=4;i<=NF;i++) link = link " " esc($i); + link = "" $3; + for (i=4;i<=NF;i++) link = link " " $i; link = link ""; bufpush(link); next; @@ -39,20 +40,17 @@ function esc(t) { /^-/ { # Unordered lists if (! (tag == "ul")) tag = "ul"; - esc($0); sub(/^-[ \t]*/, "
  • "); } /^[0-9]+\./ { # Ordered lists if (! (tag == "ol")) tag = "ol"; - esc($0); sub(/^[0-9]+\.[ \t]/, "
  • "); } /^>/ { # Blockquotes if (! (tag == "blockquote")) tag = "blockquote"; sub(/^>[ \t]*/,""); - esc($0); } /^#+/ { # Headers @@ -62,7 +60,6 @@ function esc(t) { tag = "h" RLENGTH; } sub(/^#+[ \t]*/,""); - esc($0); } /^$/ { -- cgit 1.4.1-21-gabe81