Skip to content

Commit

Permalink
Don’t calculate bookmark label when bookmark level is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Jan 26, 2024
1 parent 4edb03d commit e018bf3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions weasyprint/formatting_structure/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,7 @@ def before_after_to_box(element, pseudo_type, state, style_for,
box.children = children

# calculate the bookmark-label
if style['bookmark_label'] == 'none':
box.bookmark_label = ''
else:
if style['bookmark_level'] != 'none':
_quote_depth, counter_values, _counter_scopes = state
compute_bookmark_label(
element, box, style['bookmark_label'], counter_values,
Expand Down Expand Up @@ -669,9 +667,7 @@ def set_content_lists(element, box, style, counter_values, target_collector,
compute_string_set(
element, box, string_name, string_values, counter_values,
target_collector, counter_style)
if style['bookmark_label'] == 'none':
box.bookmark_label = ''
else:
if style['bookmark_level'] != 'none':
compute_bookmark_label(
element, box, style['bookmark_label'], counter_values,
target_collector, counter_style)
Expand Down

0 comments on commit e018bf3

Please sign in to comment.