Skip to content

Commit

Permalink
Allow suppressing the caption label
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtm committed Oct 29, 2021
1 parent 577c175 commit ed1b2b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Changed:

Fixed:

* Setting 'number_format' to *none* caused a crash; now it causes the caption
label to be omitted.
* Handle citations and corresponding citation references that are not defined
in the same source file.
* Fix error message for --stylesheet argument with relative path (issue #253,
Expand Down
9 changes: 6 additions & 3 deletions src/rinoh/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,12 @@ def referenceable(self):
return self.parent

def text(self, container):
cat = self.referenceable.category
number = self.number(container)
return MixedStyledText([cat, ' ', number, self.content], parent=self)
try:
number = self.number(container)
label = [self.referenceable.category, ' ', number]
except KeyError:
label = []
return MixedStyledText(label + [self.content], parent=self)


class FigureStyle(FloatStyle, GroupedFlowablesStyle):
Expand Down

0 comments on commit ed1b2b2

Please sign in to comment.