Skip to content

Commit

Permalink
partially address #200; don't crash if toc entry is too long
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Jun 16, 2015
1 parent 8ee8497 commit 58ba3c0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/asciidoctor-pdf/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ def layout_toc_level sections, num_levels, line_metrics, dot_width, num_front_ma
spacer_width = (width_of NoBreakSpace) * 0.75
# FIXME this calculation will be wrong if a style is set per level
num_dots = ((bounds.width - (width_of %(#{sect_title}#{sect_page_num}), inline_format: true) - spacer_width) / dot_width).floor
num_dots = 0 if num_dots < 0
# FIXME dots don't line up if width of page numbers differ
typeset_formatted_text [
{ text: %(#{(@theme.toc_dot_leader_content || DotLeaderDefault) * num_dots}), color: toc_dot_color },
Expand Down

0 comments on commit 58ba3c0

Please sign in to comment.