From 3c047aeec360c973df60887e4b4e454e0effd137 Mon Sep 17 00:00:00 2001 From: Admin Date: Sun, 11 Dec 2022 01:40:59 -0500 Subject: Leave horizontal rules --- html2md.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html2md.rb b/html2md.rb index 7b89309..fde907d 100755 --- a/html2md.rb +++ b/html2md.rb @@ -53,8 +53,8 @@ end # Replace italics body.css('i').each { |i| i.replace("*#{i.inner_text}*") } body.css('em').each { |i| i.replace("*#{i.inner_text}*") } -# Remove horizontal rules -body.css('hr').remove +# Replace horizontal rules +body.css('hr').each { |hr| hr.replace "\n\n---\n\n" } # Remove carriage returns body.search('//text()').each do |text| text.replace(text.text.gsub("\r", '')) -- cgit v1.2.3