-
Notifications
You must be signed in to change notification settings - Fork 459
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
Consecutive capitals in Math are labeled as span caps #3512
Comments
Fixes Cantera#128. Pending resolution of getnikola/nikola#3512
Sure, go ahead! (This kinda depends on the project and the maintainers, but I personally prefer and recommend just creating minor/bugfix PRs without asking if they’re appropriate — worst case scenario, they’d get closed, but they are likely to just get accepted; note that policies differ in different projects; projects that mandate having a issue ticket first exist too.)
This might be a bit complicated, but I don’t think many users would be interested in using |
@Kwpolska Thanks for In any case, we can continue discussing a possible UI for One way to approach this is to give a default @apply_to_text_file
def typogrify_custom(data, typogrify_filters=None, ignore_tags=None):
"""Run typogrify with a custom list of fliter functions."""
if typo is None:
req_missing(['typogrify'], 'use the typogrify filter', optional=True)
return data
if typogrify_filters is None:
typogrify_filters = [typo.amp, typo.widont, typo.smartypants, typo.caps, typo.initial_quotes]
return _run_typogrify(data, typogrify_filters, ignore_tags) Then, in from nikola import filters
import functools
FILTERS = {".html": [functools.partial(filters.typogrify_custom, ignore_tags=["tag-to-ignore"])]} The only other question I would have is should the user-passed list of |
I’m okay with allowing |
Environment
Python Version: 3.9.1
Nikola Version: 8.1.3
Operating System: macOS
Description:
In Nikola 8.1.2, the
caps
typogrify filter was re-enabled. Unfortunately, consecutive capital letters in math mode (when enabled) also trigger the filter, resulting in broken equations. I think the simplest fix is to add the.math
CSS class to the ignored tags here:nikola/nikola/filters.py
Line 272 in c49f959
Aside from that, in trying to debug this issue, I could not determine how to pass options to the
typogrify_custom
filter.typogrify_custom
is the only filter wrapped byapply_to_text_file
that has more than one argument, and it is not wrapped by the_ConfigurableFilter
class to read an option fromconf.py
. In the end, I had to create afunctools.partial
in myconf.py
that passed the list oftypogrify_filters
to apply as well as the modifiedignore_tags
.If that's the intended interface, it would be nice to support a default list of applied filters, in case the user only wants to edit the
ignore_tags
(and vice-versa).Please let me know if I should create a pull request with my suggested fix for the
.math
issue!References:
Cantera/cantera-website#128
#3447 (and linked issues)
The text was updated successfully, but these errors were encountered: