diff --git a/lib/repubmark/elems/article.rb b/lib/repubmark/elems/article.rb
index 2c14bae..1069a6c 100644
--- a/lib/repubmark/elems/article.rb
+++ b/lib/repubmark/elems/article.rb
@@ -33,7 +33,9 @@ module Repubmark
@annotation&.to_html,
@chapter&.to_html,
@epilogue&.to_html,
+ @footnotes_categories.any? ? "
\n
\n" : nil,
*@footnotes_categories.map(&:to_html),
+ @footnotes_categories.any? ? "\n" : nil,
].compact.join.freeze
end
diff --git a/lib/repubmark/elems/footnote.rb b/lib/repubmark/elems/footnote.rb
index 18f1606..7394fa7 100644
--- a/lib/repubmark/elems/footnote.rb
+++ b/lib/repubmark/elems/footnote.rb
@@ -39,11 +39,15 @@ module Repubmark
result += "\n"
end
end
- result += %(#{text}\n)
+ result += %(#{text})
else
- result += %(#{text}\n)
+ result += text
+ end
+ if descr
+ result += " — #{descr}\n"
+ else
+ result += "\n"
end
- result += " — #{descr}\n" if descr
if alt_urls&.any?
result += %[(#{
alt_urls.map do |alt_url|