Skip to content

Commit

Permalink
Merge pull request #8 from the-curve-consulting/pault/pwm-269
Browse files Browse the repository at this point in the history
PWM-269: Do not create a new paragraph on page break
  • Loading branch information
nossidge authored Apr 30, 2024
2 parents 3e5e21f + fed9370 commit 9b05ee7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
16 changes: 5 additions & 11 deletions lib/caracal/renderers/document_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,7 @@ def render_pageflip(xml, model)
end

def render_pagebreak(xml, model)
if model.page_break_wrap
xml['w'].p paragraph_options do
xml['w'].r run_options do
xml['w'].br({ 'w:type' => 'page' })
end
end
else
xml['w'].r run_options do
xml['w'].br({ 'w:type' => 'page' })
end
end
@pagebreak_on_next_paragraph = true
end

def render_paragraph(xml, model)
Expand All @@ -389,6 +379,10 @@ def render_paragraph(xml, model)
xml['w'].contextualSpacing({ 'w:val' => '0' })
xml['w'].jc({ 'w:val' => model.paragraph_align }) unless model.paragraph_align.nil?
render_run_attributes(xml, model, true)
if @pagebreak_on_next_paragraph
xml['w'].pageBreakBefore
@pagebreak_on_next_paragraph = false
end
end
model.runs.each do |run|
method = render_method_for_model(run)
Expand Down
2 changes: 1 addition & 1 deletion lib/caracal/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Caracal
VERSION = '1.4.5'
VERSION = '1.4.6'
end

0 comments on commit 9b05ee7

Please sign in to comment.