Last night, I’ve applied Typogrify to this blog. It’s a default plugin in Pelican.
But I found strange result. The title has unnecessary glitch on it. In the
pelican source,
I could find that Typogrify is adding the tag intentionally. Then, the
template should be remove that. Jinja2 has
striptags
filter.
I’ve tested the following code.
from typogrify.filters import typogrify
from jinja2.filters import do_striptags
TEST_STR = 'Hello WORLD'
print(TEST_STR) # Hello WORLD
print(typogrify(TEST_STR)) # Hello <span class="caps">WORLD</span>
print(do_striptags(typogrify(TEST_STR))) # Hello WORLD
Each libraries work as expected. Then it was the time to check the template
files. And apparently, in aritcle.html
, striptags
filter wasn’t applied to
article.title
variable.
I forked pelican-blue template source, and cloned it to my local direcotyr, and created a commit, and pushed it into my cloned repo, and created a pull request.
And this morning, it’s merged!
I’ve reported some issues on some open source project, but this is the first time that my code is included in the existing project.
Comments !