| class ArraySegment(Segment): | class ArraySegment(Segment): | ||||
| @property | |||||
| def text(self) -> str: | |||||
| # Return empty string for empty arrays instead of "[]" | |||||
| if not self.value: | |||||
| return "" | |||||
| return super().text | |||||
| @property | @property | ||||
| def markdown(self) -> str: | def markdown(self) -> str: | ||||
| items = [] | items = [] | ||||
| @property | @property | ||||
| def text(self) -> str: | def text(self) -> str: | ||||
| # Return empty string for empty arrays instead of "[]" | |||||
| if not self.value: | |||||
| return "" | |||||
| return json.dumps(self.value, ensure_ascii=False) | return json.dumps(self.value, ensure_ascii=False) | ||||