pelican-plugins / render-math

Pelican plugin that renders mathematics via the MathJax JavaScript engine
Other
30 stars 7 forks source link

process_summary() fails to set new summary properly #7

Closed jwodder closed 4 years ago

jwodder commented 4 years ago

After process_summary() is called on an article, article.summary remains the same, even if it contains mathematics. I believe the problem is that article._summary isn't used by any code paths after you set it; perhaps you should set article.metadata["summary"] instead.

This gist serves as a demonstration of the bug. Use it as follows:

* Summary before processing: '<p class="first last">Here we prove that <span class="math">\\(\\sum_{i=1}^n i = \\frac{n^2+n}{2}\\)</span></p>\n'
* Summary after processing: '<p class="first last">Here we prove that <span class="math">\\(\\sum_{i=1}^n i = \\frac{n^2+n}{2}\\)</span></p>\n'
Done: Processed 1 article, 0 drafts, 0 pages, 0 hidden pages and 0 draft pages in 0.13 seconds.

Note that the summary remains the same. Also note that MathJax is not present in output/index.html.

justinmayer commented 4 years ago

Hi @jwodder. Is this issue something you would be willing to help out with? We could really use the assistance! 😅

jwodder commented 4 years ago

@justinmayer My suspicion about how to fix the problem turned out to be correct; I have submitted a patch as PR #9.

justinmayer commented 4 years ago

@jwodder: Many thanks for fixing this! Addressed via https://github.com/pelican-plugins/render-math/commit/93f53605d47163bcb4d73631f1719ffb39f1fb92 and released as Render Math 1.0.2.