Fix mathjax on edit and create pages (#1773)

* Fix mathjax on edit and create pages
This commit is contained in:
fhchl
2021-12-22 17:00:31 +01:00
committed by GitHub
parent d97721f38b
commit 98a0006c86
5 changed files with 26 additions and 24 deletions
+2 -2
View File
@@ -20,6 +20,7 @@ require 'gollum/views/layout'
require 'gollum/views/editable'
require 'gollum/views/has_page'
require 'gollum/views/has_user_icons'
require 'gollum/views/has_math'
require 'gollum/views/pagination'
require 'gollum/views/rss.rb'
require 'gollum/views/template_cascade'
@@ -125,6 +126,7 @@ module Precious
@css = settings.wiki_options[:css]
@js = settings.wiki_options[:js]
@mathjax_config = settings.wiki_options[:mathjax_config]
@mathjax = settings.wiki_options[:mathjax]
@use_static_assets = settings.wiki_options.fetch(:static, settings.environment != :development)
@static_assets_path = settings.wiki_options.fetch(:static_assets_path, ::File.join(File.dirname(__FILE__), 'public/assets'))
@@ -217,7 +219,6 @@ module Precious
if page = wikip.page
@page = page
@content = page.text_data
@mathjax = wiki.mathjax
@etag = page.sha
mustache :edit
else
@@ -613,7 +614,6 @@ module Precious
# Extensions and layout data
@editable = true
@toc_content = wiki.universal_toc ? @page.toc_data : nil
@mathjax = wiki.mathjax
@h1_title = wiki.h1_title
@bar_side = wiki.bar_side
@allow_uploads = wiki.allow_uploads
+1
View File
@@ -2,6 +2,7 @@ module Precious
module Views
class Create < Layout
include Editable
include HasMath
attr_reader :page, :name
+1 -4
View File
@@ -3,6 +3,7 @@ module Precious
class Edit < Layout
include Editable
include HasPage
include HasMath
attr_reader :page, :content
@@ -19,10 +20,6 @@ module Precious
@name
end
def mathjax
@mathjax
end
def header
if @header.nil?
if page = @page.header
+11
View File
@@ -0,0 +1,11 @@
module Precious
module HasMath
def mathjax
@mathjax
end
def mathjax_config
@mathjax_config
end
end
end
+1 -8
View File
@@ -2,6 +2,7 @@ module Precious
module Views
class Page < Layout
include HasPage
include HasMath
attr_reader :content, :page, :header, :footer, :preview, :historical
@@ -157,14 +158,6 @@ module Precious
@toc_content
end
def mathjax
@mathjax
end
def mathjax_config
@mathjax_config
end
def use_identicon
@page.wiki.user_icons == 'identicon'
end