Skip to content
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

MathJax processor ignores files with only $$ (display notation) and text when optimization is enabled #36

Closed
woodenbell opened this issue Dec 5, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@woodenbell
Copy link

woodenbell commented Dec 5, 2020

As the title says, when running the server with the latest version of the plugin (0.9.6) with default configs (optimize has enable: true for mathjax), the MathJax processor is only called on files which have either only mathjax display notation (text between pairs of $$) and no text or have the inline notation (pairs of $).

When using $$ and regular text or without $ in that same post, nothing happens.

Below are some screenshots of examples. Setting enable: false in the optimize config for MathJax seems to solve the issue.

The repository is available here.

Screenshot_2020-12-04 Testing math
Screenshot_2020-12-04 Using only the display notation (no text) works
Screenshot_2020-12-04 Testing math 2

@jeffreytse jeffreytse self-assigned this Dec 5, 2020
@jeffreytse jeffreytse added the bug Something isn't working label Dec 5, 2020
@jeffreytse
Copy link
Owner

Hi @woodenbell

Thanks for your issue firstly. And currently the issue has been addressed.

The minimal test project Gemfile as below:

source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.1.1"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.12"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
  gem "tzinfo", "~> 1.2"
  gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

gem "jekyll-spaceship", "0.9.6"

The issue could be summarized as below:

  1. The post content has only $$..$$ mathjax expression and no any other content (Normal):
$$ 2 - 1 = 1 $$
$$ 2 - 1 = 1 $$

$$ 2 - 1 = 1 $$
  1. The post content has only $$..$$ mathjax expression and any other content (Abnormal):
$$ 2 - 1 = 1 $$

Here is pure text.
$$ 2 - 1 = 1 $$

<!-- Here is pure text. -->
$$ 2 - 1 = 1 $$

$$ 3 - 1 = 2 $$

<!-- Here is pure text. -->
  1. The post content has only one $$..$$ and any other patterns ($..$, \\\[...\\\], etc.) of mathjax expressions (Normal):
\\\( 2 - 1 = 1 \\\)

$$ 2 - 1 = 1 $$
\\\[2 - 1 = 1\\\]

$$ 2 - 1 = 1 $$
\\\[2 - 1 = 1\\\]

$$ 2 - 1 = 1 $$

Here is pure text.

Thanks and regards

@jeffreytse
Copy link
Owner

jeffreytse commented Dec 5, 2020

Hi @woodenbell

Now the issue has been fixed, and could you update it for your test?
For using gem directly from git repositories. In your Gemfile:

# To install a gem from its github repository
gem "jekyll-spaceship", git: "https://github.com/jeffreytse/jekyll-spaceship.git"

And then install gems again:

$ bundle install

Thanks and regards

@woodenbell
Copy link
Author

woodenbell commented Dec 6, 2020

Hi @jeffreytse
The issue has been fixed. Thanks a lot!
Screenshot_2020-12-05 Testing math

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants