Jekyll issue rendering ⅓

I’m using the convention of ½ to output fractions to my page but it seems like ⅓ isn’t rendering and is showing up literally as “⅓” on the page instead of 1/3. I’ve tried googling a bit and have come up empty.

Here’s what I’ve tried:

  • Using different font
  • Not specifying the font at all so the browser just uses the default
  • Verifying that the fraction even works by using another markdown engine (in this case it was Github). As far as I can see ⅓ is supposed to render to 1/3.

Any help is greatly appreciated.

I don’t understand - what do you want it to show up as? do you have an example of what you want it to show as?

is there a public page to see what you have done?

Sorry, looks like it even works in this forum.

Here’s a screenshot from the webpage
Screenshot from 2022-09-28 20-45-18
Webpage itself, live: Cookbook | Penne alla Vodka
Github: GitHub - deadbody13/ Cookbook website

What I’m trying to do is get ⅓ to be ⅓ but for some reason it’s not really playing well.

interesting, I would assume this is a markdown parser issue.

Have you tried using ⅓ directly in the md file? I think as long as everything is UTF8 it would work?

I think this is the issue you are seeing:

This looks almost exactly like what I’m experiencing. All of this is written directly to the markdown file and what’s curious is that if I run it through pandoc and output to an HTML file it works without complaining. It’s even more curious that it seems to only have problems with ⅓.

I appreciate you pointing me to this thread. I’ll explore it tomorrow to see what workarounds there are.

I did a test and just using ⅓ directly in a md file worked fine for me on GH pages.

This could be a limitation of kramdown.
My local tests shows that kramdown only renders ½ ¼ and ¾ correctly with Jekyll’s default configuration.
You may need to reach out GitHub - gettalong/kramdown: kramdown is a fast, pure Ruby Markdown superset converter, using a strict syntax definition and supporting several common extensions. for further assistance.

Yeah, it looks like this has nothing to do with Jekyll and is almost all due to a Kramdown bug. I might see if there’s a workaround, I like being able to use the ⅓ notation but if I can’t find a way around it I guess it can’t be helped.

I just found my workaround it seems. I left Kramdown for CommonMarkGhPages.


# _config.yml

# change markdown processor
markdown: CommonMarkGhPages
# Gemfile

# change jekyll version from 4.2.2 to 3.9.0
gem "jekyll", "~> 3.9.0"
# add plugin
group :jekyll_plugins do
  gem 'jekyll-commonmark-ghpages'

And then I ran bundle exec jekyll build.

Pretty sure these are the only changes I made, but now ⅓ renders perfectly to ⅓.

Was Jekyll downgraded from 4.2.2 to 3.9 for this situation or was it for a different situation?

Running bundle exec jekyll build would throw a Bundler error saying:

Bundler could not find compatible versions for gem "jekyll":
  In Gemfile:
    jekyll (~> 4.2.2)

    jekyll-commonmark-ghpages was resolved to 0.2.0, which depends on
      jekyll (~> 3.9.0)

so I downgraded it and now it’s working fine… as far as I can tell. I imagine there might be some quirk showing up later on.