summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdmin <admin@marx.cafe>2022-12-11 01:40:59 -0500
committerAdmin <admin@marx.cafe>2022-12-11 01:40:59 -0500
commit3c047aeec360c973df60887e4b4e454e0effd137 (patch)
tree65264db2d839ba621df65ba001d1ffcae8cc5baf
parente151ddc9b6e4dff08619402d4415ac26d1a15836 (diff)
Leave horizontal rules
-rwxr-xr-xhtml2md.rb4
1 files 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", ''))