diff options
author | Admin <admin@marx.cafe> | 2022-12-04 23:39:26 -0500 |
---|---|---|
committer | Admin <admin@marx.cafe> | 2022-12-04 23:39:26 -0500 |
commit | acbf341e84898bff72d51ee861d968f3c7868afd (patch) | |
tree | 674e5adab854a0fd2031a7413df052ae22cc95b9 | |
parent | 3be759d8b01ee055db794d0a146057e409ea844b (diff) |
Fix trailing whitespace in tags
-rwxr-xr-x | html2md.rb | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -98,4 +98,7 @@ body_text = if body.at_css('blockquote > div.border') body.children.to_html end +# Fix cases where <em> or <i> tags contain trailing whitespace +body_text.gsub!(/(\*\b[^*]+) +(\*+)/, '\1\2 ') + puts body_text.lines.map(&:strip).join("\n").gsub(/\n\n\n+/, "\n\n") |