Remove hard-coded, preceding space of figure caption prefix #446
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
Removed the hard-coded space that precedes the figure caption prefix to permit captions similar to Table captions, such as
Figure N. Xyz...
.The relevant change is on line 56,
self.prefix_figure = f"{prefix_figure} "
. All other changes were formatting to passblack
andflake8
checks.Before:
prefix
="."
figure_prefix
=" {prefix} "
{figure_label} N{figure_prefix}
->"Figure N . "
After:
prefix
="."
figure_prefix
="{prefix} "
{figure_label} N{figure_prefix}
->"Figure N. "
Alternate Designs
There were no other methods observed to prevent the preceding space that would allow for
Figure N. Xyz...
.It might be beneficial in the long-term to remove the hard-coded space after the prefix, too, to provide the most flexibility for Ghostwriter admins and users.
Possible Drawbacks
This will require current users that expect the preceding, hard-coded space to change their figure prefix from "-" to " -" if they need the spacing. Or, perhaps, this PR should be accompanied by a modification to add a space to the current figure prefix. I'll look into that.
Re-configuring the install defaults from "-" to " -" may be desired, too.
Verification Process
I'll follow up with tests and needed changes whenever I can get Docker and Ghostwriter functional on my development system.
Release Notes