mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Merge pull request #2773 from urbanrotnik/ur-sci-4879-word-format-fix
Fix word reports when using headings [SCI-4879]
This commit is contained in:
commit
f5ffd685d8
1 changed files with 11 additions and 6 deletions
|
@ -19,12 +19,17 @@ module Reports::Docx::PrivateMethods
|
||||||
tiny_mce_table(elem[:data])
|
tiny_mce_table(elem[:data])
|
||||||
elsif elem[:type] == 'newline'
|
elsif elem[:type] == 'newline'
|
||||||
style = elem[:style] || {}
|
style = elem[:style] || {}
|
||||||
|
# print heading if its heading
|
||||||
|
# Mixing heading with other style setting causes problems for Word
|
||||||
|
if %w(h1 h2 h3 h4 h5).include?(style[:style])
|
||||||
|
@docx.public_send(style[:style], elem[:value])
|
||||||
|
else
|
||||||
@docx.p elem[:value] do
|
@docx.p elem[:value] do
|
||||||
align style[:align]
|
align style[:align]
|
||||||
color style[:color]
|
color style[:color]
|
||||||
bold style[:bold]
|
bold style[:bold]
|
||||||
italic style[:italic]
|
italic style[:italic]
|
||||||
style style[:style] if style[:style]
|
end
|
||||||
end
|
end
|
||||||
elsif elem[:type] == 'image'
|
elsif elem[:type] == 'image'
|
||||||
Reports::Docx.render_img_element(@docx, elem)
|
Reports::Docx.render_img_element(@docx, elem)
|
||||||
|
|
Loading…
Reference in a new issue