Skip to content

Commit

Permalink
Merge pull request #2086 from VagnerNico/vn/fix-weasyprint-empty-valu…
Browse files Browse the repository at this point in the history
…e-for-select

Fixed selects with empty values displaying None
  • Loading branch information
liZe authored Mar 4, 2024
2 parents 28be5bd + 37fd99c commit 2c09a86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weasyprint/pdf/anchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def add_inputs(inputs, matrix, pdf, page, resources, stream, font_map,
selected_values = []
for option in element:
value = pydyf.String(option.attrib.get('value', ''))
text = pydyf.String(option.text)
text = pydyf.String(option.text or "")
options.append(pydyf.Array([value, text]))
if 'selected' in option.attrib:
selected_values.append(value)
Expand Down

0 comments on commit 2c09a86

Please sign in to comment.