Skip to content

Commit

Permalink
engine/postprocessing.py: glue caption to figure
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagnus committed Jul 27, 2022
1 parent b05350c commit 1877c3d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions engine/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,19 @@ def get_todo(text):
return ntext


def get_captions(text):
def get_captions(text): #figure
"""Replace *in text* @todo, @inprogress and @done with `<span class="label label-danger">@todo</span>` and so on.
"""
ntext = ''
for l in text.split('\n'):
if l.startswith('Fig.') or l.startswith('Figure.'):
style = '<small><b style="background-color: white;">Figure.</b>'
style = '<small><b alt="caption" style="">Figure. </b>'
l = l.replace('Figure.', style)
l = l.replace('Fig.', style)
l += '</small>'
ntext += l + '\n'
ntext += l + '\n' #\n<small><b style="">Figure.</b> -> <small><b style="">Figure.</b>
ntext = ntext.replace('\n<small><b alt="caption"', '<small><b alt="caption"')

return ntext

def get_divhr(text):
Expand Down

0 comments on commit 1877c3d

Please sign in to comment.