Implement spacing before/after for paragraphs
All checks were successful
CI Pipeline / build (push) Successful in 47s
All checks were successful
CI Pipeline / build (push) Successful in 47s
This commit is contained in:
@@ -52,9 +52,18 @@ module Notare
|
||||
|
||||
def render_paragraph(xml, para)
|
||||
xml["w"].p do
|
||||
if para.style
|
||||
has_style = para.style
|
||||
has_spacing = para.spacing_before || para.spacing_after
|
||||
|
||||
if has_style || has_spacing
|
||||
xml["w"].pPr do
|
||||
xml["w"].pStyle("w:val" => para.style.style_id)
|
||||
xml["w"].pStyle("w:val" => para.style.style_id) if has_style
|
||||
if has_spacing
|
||||
spacing_attrs = {}
|
||||
spacing_attrs["w:before"] = para.spacing_before.to_s if para.spacing_before
|
||||
spacing_attrs["w:after"] = para.spacing_after.to_s if para.spacing_after
|
||||
xml["w"].spacing(spacing_attrs)
|
||||
end
|
||||
end
|
||||
end
|
||||
para.runs.each { |run| render_run(xml, run) }
|
||||
|
||||
Reference in New Issue
Block a user