Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct regression for #3809 #3817

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions app/helpers/export_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,9 @@ def xml_to_pandoc_md(xml_text, preserve_lb=true, flatten_links=false, collection
n.replace("REPLACEMETABLE#{i}")
end

# now back to REXML
# html = xml_to_html(postprocessed, preserve_lb, flatten_links, collection)
# doc = REXML::Document.new("<html>#{html}</html>")
# doc.elements.each_with_index("//table") do |n,i|
# n.replace_with(REXML::Text.new(markdown_tables[i]))
# end
html = doc.to_s
# html=postprocessed
postprocessed = doc.to_s
# do the conversions for linebreaks, italics, etc.
html = xml_to_html(postprocessed, preserve_lb, flatten_links, collection)

if div_pad
doc = REXML::Document.new("<div>#{html}</div>")
Expand All @@ -57,11 +52,6 @@ def xml_to_pandoc_md(xml_text, preserve_lb=true, flatten_links=false, collection
e.replace_with(REXML::Text.new(" "))
end
end
if preserve_lb
doc.elements.each("//lb") do |e|
e.replace_with(REXML::Element.new("br"))
end
end

html=''
doc.write(html)
Expand Down