|
@@ -187,7 +187,7 @@ def process_summary(article):
|
|
"""Ensures summaries are not cut off. Also inserts
|
|
"""Ensures summaries are not cut off. Also inserts
|
|
mathjax script so that math will be rendered"""
|
|
mathjax script so that math will be rendered"""
|
|
|
|
|
|
- summary = article._get_summary()
|
|
|
|
|
|
+ summary = article.summary
|
|
summary_parsed = BeautifulSoup(summary, 'html.parser')
|
|
summary_parsed = BeautifulSoup(summary, 'html.parser')
|
|
math = summary_parsed.find_all(class_='math')
|
|
math = summary_parsed.find_all(class_='math')
|
|
|
|
|
|
@@ -199,6 +199,12 @@ def process_summary(article):
|
|
math[-1].string = "%s ..." % full_text
|
|
math[-1].string = "%s ..." % full_text
|
|
summary = summary_parsed.decode()
|
|
summary = summary_parsed.decode()
|
|
|
|
|
|
|
|
+ # clear memoization cache
|
|
|
|
+ import functools
|
|
|
|
+ if isinstance(article.get_summary, functools.partial):
|
|
|
|
+ memoize_instance = article.get_summary.func.__self__
|
|
|
|
+ memoize_instance.cache.clear()
|
|
|
|
+
|
|
article._summary = "%s<script type='text/javascript'>%s</script>" % (summary, process_summary.mathjax_script)
|
|
article._summary = "%s<script type='text/javascript'>%s</script>" % (summary, process_summary.mathjax_script)
|
|
|
|
|
|
def configure_typogrify(pelicanobj, mathjax_settings):
|
|
def configure_typogrify(pelicanobj, mathjax_settings):
|