Skip to content

Conversation

fhchl
Copy link
Contributor

@fhchl fhchl commented Oct 22, 2021

Fixes #1772

I don't have much ruby experience, but I think this patch works as expected. Apart from those that err on master, all test are running.

@@ -29,6 +29,14 @@ def page_name
@name
end

def mathjax
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we would refactor #mathjax and #mathjax_config into a module HasMath, analogous to this -- and include that in the Page, Edit, and Create views.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea. Done!

@@ -365,6 +365,7 @@ class App < Sinatra::Base
@name = wikip.name
@ext = wikip.ext
@path = wikip.path
@mathjax = wikip.wiki.mathjax
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need @mathjax_config here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I guess not, because that is already set in the before block called before each block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly. Actually, the options are global so one could move all @mathjax to the before block where @mathjax_config is set.

@@ -37,6 +37,10 @@
{{#sprockets_javascript_tag}}editor{{/sprockets_javascript_tag}}
{{/has_editor}}
{{#mathjax}}
{{#mathjax_config}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change break existing custom mathjax configs? If I read it correctly, we currently load the default config, then load mathjax_config_path in addition. Whereas if I am right, these changes mean we only load the default config when a custom config is not enabled.

If I've misunderstood, please clarify -- the changes are a bit difficult to read!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true. I didn't realize that the given config was non standard. Will revert.

@fhchl
Copy link
Contributor Author

fhchl commented Oct 22, 2021

I implemented your comments @dometto.

@dometto dometto self-requested a review October 23, 2021 10:20
Copy link
Member

@dometto dometto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks for the PR @fhchl. Anyone else for a quick sanity check?

@bartkamphorst bartkamphorst self-requested a review October 25, 2021 12:19
@dometto
Copy link
Member

dometto commented Oct 27, 2021

I forgot I had to run the tests manually (for first-time PR submitters), there appear to be two failures on JRuby that I can't reproduce locally on this branch. It may be a difference in the environment but haven't figured it out yet. @fhchl if you have any idea what could be causing this please let me know

@fhchl
Copy link
Contributor Author

fhchl commented Oct 29, 2021

Is this a problem with this pull request? Seems like the same test fails on the current master branch (https://github.com/gollum/gollum/actions/runs/1394458089)

@dometto
Copy link
Member

dometto commented Oct 30, 2021

You're right, it didn't fail on master until I recently merged a change to the Readme -- which makes it pretty clear that it must be a problem with the latest JRuby.

@dometto dometto merged commit 98a0006 into gollum:master Dec 22, 2021
@dometto
Copy link
Member

dometto commented Dec 22, 2021

Sorry for the long wait and thanks again for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mathjax not properly loaded on new pages and page edit
4 participants