Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support endash as caption separator #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Pandoc-fignos may be customized by setting variables in the [metadata block] or
* `fignos-caption-separator` or `xnos-caption-separator` - Sets
the caption separator (e.g., the colon in "Figure 1:") to
something else. It must be one of `none`, `colon`,
`period`, `space`, `quad`, or `newline`; and
`period`, `space`, `quad`, `endash`, or `newline`; and

* `fignos-number-by-section` or `xnos-number-by-section` - Set to
`True` to number figures by section (e.g., Fig. 1.1, 1.2, etc in
Expand Down
4 changes: 2 additions & 2 deletions pandoc_fignos.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _adjust_caption(fmt, fig, value):
if fig['is_unnumbered']:
return
sep = {'none':'', 'colon':':', 'period':'.', 'space':' ',
'quad':u'\u2000', 'newline':'\n'}[separator]
'quad':u'\u2000', 'newline':'\n', 'endash':u'\u2013'}[separator]

num = targets[attrs.id].num
if isinstance(num, int): # Numbered target
Expand Down Expand Up @@ -442,7 +442,7 @@ def process(meta):
old_separator = separator
separator = get_meta(meta, name)
if separator not in \
['none', 'colon', 'period', 'space', 'quad', 'newline']:
['none', 'colon', 'period', 'space', 'quad', 'newline', 'endash']:
msg = textwrap.dedent("""
pandoc-fignos: caption separator must be one of
none, colon, period, space, quad, or newline.
Expand Down