From 622d898e1637d01e14c2e92b913214857c00f901 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 31 Dec 2024 15:36:43 +0200 Subject: feat(single): Implement horizontal rules --- single.awk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'single.awk') diff --git a/single.awk b/single.awk index 47cb391..726f519 100644 --- a/single.awk +++ b/single.awk @@ -7,8 +7,8 @@ # [x] Headers (atx and setex) # [x] Blockquotes # [ ] Lists -# [ ] Horizontal rules # [x] Code blocks +# [x] Horizontal rules # [ ] Span elements # [ ] Links # [ ] Inline @@ -144,6 +144,12 @@ inside_codeblock && ! /^[ \t]*$/ { not_paragraph = 1 } +# Horizontal rule +/^(---+|- - -( -)*|\*\*\*+|\* \* \*( \*)*|___+|_ _ _( _)*)$/ { + $0 = "
" + not_paragraph = 1 +} + # Paragraph emptyP1 && !empty0 && !not_paragraph { $0 = "

" $0 } !emptyP1 && empty0 && !not_paragraph_p1 { P1 = P1 "

" } -- cgit v1.3.1-26-gb76a