Fallback plain text for a property, honouring prop_display settings. For {…} expressions the braces are stripped so the raw expression is shown when LaTeX rendering is unavailable. Returns "" when nothing should be shown.
(self, key: str)
| 585 | return self.params.get(key, "") |
| 586 | |
| 587 | def _prop_text(self, key: str) -> str: |
| 588 | """ |
| 589 | Fallback plain text for a property, honouring prop_display settings. |
| 590 | For {…} expressions the braces are stripped so the raw expression is |
| 591 | shown when LaTeX rendering is unavailable. |
| 592 | Returns "" when nothing should be shown. |
| 593 | """ |
| 594 | show_val, show_name = self.prop_display.get(key, (False, False)) |
| 595 | if not show_val: |
| 596 | return "" |
| 597 | val = self._prop_value(key) |
| 598 | if not val: |
| 599 | return "" |
| 600 | # strip braces for plain-text display of expressions |
| 601 | display_val = val.strip() |
| 602 | if display_val.startswith("{") and display_val.endswith("}"): |
| 603 | display_val = display_val[1:-1].strip() |
| 604 | return f"{key} = {display_val}" if show_name else display_val |
| 605 | |
| 606 | # ── label management ────────────────────────────────────────────────────── |
| 607 |
no test coverage detected