From d347c2ee4c941419cf75d252cf04fcbda2c6286a Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 1 Jan 2025 11:37:23 +0200 Subject: feat(single): Support for original markdown specification --- single.awk | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) (limited to 'single.awk') diff --git a/single.awk b/single.awk index 1e48ce7..7698bca 100644 --- a/single.awk +++ b/single.awk @@ -1,26 +1,10 @@ -# Status: -# [.] Inline HTML -# [x] Autoescape -# [x] Block elements -# [x] Paragraph -# [x] Line break -# [x] Headers (atx and setex) -# [x] Blockquotes -# [x] Lists -# [x] Code blocks -# [x] Horizontal rules -# [x] Span elements -# [x] Links -# [x] Inline -# [x] Reference -# [x] Emphasis -# [x] Code -# [x] Images -# [x] Inline -# [x] Reference -# [x] Other -# [x] Autolinks -# [x] Escapes +# Almost the entire canonical Markdown specification is supported +# https://daringfireball.net/projects/markdown/syntax +# Notable behavioural exceptions are: +# - Block-level HTML elements needn't be separated with blank lines +# - Lists are identation-aware. List items begin and continue after the same +# identation with which the list beginning (e.g. "* " or "5. ") was written. +# The benefit is that all Markdown is parsed as normal inside an item. # # [ ] Non-standard features # [ ] Strikethrough ~~...~~ @@ -36,15 +20,8 @@ # [ ] Links # [ ] Link destination ( inside anchors) # [ ] Nested links -# No character classes, since they aren't supported on every system # -# Limitations: -# - definition lists always contain one element, i.e. multiple definitions -# aren't merged into the same list -# - emphasis which isn't surrounded by blanks is still treated as emphasis -# e.g. "some_text_here" will become "sometexthere" -# - emphasis inside inline code block is still converted to HTML -# - backticks inside `` emphasis blocks aren't escaped +# No character classes have been used, since they aren't supported on every system function empty(value) { return value == "" @@ -108,7 +85,7 @@ BEGIN { } # Output is buffered on multiple lines, held in these variables: -# P2 = previous non-empty line +# P2 = last non-empty line before the previous line # P1 = previous line # $0 = current line # N1 = next new line (N1 is always set by the user) -- cgit v1.3.1-23-gd82d