From eee9d34b4da47bf355c86a0e3819fa0be4515c1e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 15 Jun 2022 10:28:56 -0500 Subject: Add posts mostly --- ht3.awk | 56 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 14 deletions(-) (limited to 'ht3.awk') diff --git a/ht3.awk b/ht3.awk index 996cb1a..5226af7 100755 --- a/ht3.awk +++ b/ht3.awk @@ -15,45 +15,71 @@ BEGIN { } # Output buffer. The output will be chunked into blocks. BUFFER = "" + # Default block type + DEFAULT_BLOCK = "p" # The current block type. We start with a standard paragraph. - BLOCK = "p" + BLOCK = DEFAULT_BLOCK } ### RAW TEXT /^>>>/ { + BLOCK = "raw" + if ($1) { + split($1, raw_type, ",") + } } /^<</ { # Block quote +/^>/ { # Block quote } -/^-/ { # Unordered list +/^-/ { # Unordered list } -/^[0-9]\./ { # Ordered list +/^[0-9]\./ { # Ordered list } -/^---$/ { # Section break +/^---$/ { # Section break +} + +/^$/ { # End a block + buflush() + BLOCK = DEFAULT_BLOCK } ### LINES -/^=>/ { # Link +/^=>/ { # Link } -/^