From 0994541af9700765f2b4166be4ac128941042290 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Thu, 12 Sep 2024 06:01:41 +0400 Subject: [PATCH] tmp --- lib/repubmark/elems/article.rb | 2 ++ lib/repubmark/elems/footnote.rb | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) 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|