From 006dd36078bbefd8a0dd883cbbb9f1f1cc4e989b Mon Sep 17 00:00:00 2001 From: Bart Kamphorst Date: Fri, 28 Dec 2018 22:07:07 +0100 Subject: [PATCH] Make mathjax.config.js the standard filename. Fixes #1340. --- bin/gollum | 5 +---- lib/gollum/app.rb | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/bin/gollum b/bin/gollum index 1880c175..e28e37f5 100755 --- a/bin/gollum +++ b/bin/gollum @@ -134,6 +134,7 @@ MSG opts.on("--mathjax", "Enable MathJax (renders mathematical equations).", "By default, uses the 'TeX-AMS-MML_HTMLorMML' config with the 'autoload-all' extension.") do wiki_options[:mathjax] = true + wiki_options[:mathjax_config] = 'mathjax.config.js' end opts.on("--critic-markup", "Enable support for annotations using CriticMarkup.") do wiki_options[:critic_markup] = true @@ -155,10 +156,6 @@ MSG "Can be set to 'gravatar', 'identicon' or 'none'. Default: 'none'.") do |mode| wiki_options[:user_icons] = mode end - opts.on("--mathjax-config [FILE]", "Specify path to a custom MathJax configuration.", - "If not specified, uses the '/mathjax.config.js' file.") do |file| - wiki_options[:mathjax_config] = file || 'mathjax.config.js' - end opts.on("--template-dir [PATH]", "Specify custom mustache template directory.") do |path| wiki_options[:template_dir] = path end diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb index 22c2908f..88bc9ce2 100644 --- a/lib/gollum/app.rb +++ b/lib/gollum/app.rb @@ -152,15 +152,15 @@ module Precious end end - get %r{/(edit|create)/custom\.(js|css)} do + get %r{/(edit|create)/(custom|mathjax\.config\.)\.(js|css)} do forbid('Changing this resource is not allowed.') end - post %r{/(delete|rename|edit|create)/custom\.(js|css)} do + post %r{/(delete|rename|edit|create)/(custom|mathjax\.config\.)\.(js|css)} do forbid('Changing this resource is not allowed.') end - post %r{/revert/custom\.(js|css)/.*/.*} do + post %r{/revert/(custom|mathjax\.config\.)\.(js|css)/.*/.*} do forbid('Changing this resource is not allowed.') end