Fix BlahTeX/PNG Path
Dunno why Ari tolerated this up till now.
This commit is contained in:
parent
d3db9d1229
commit
9dc59b7b7c
|
@ -90,7 +90,7 @@ module Engines
|
|||
:html_math_output_png => true,
|
||||
:html_png_engine => 'blahtex',
|
||||
:html_png_dir => @content.web.files_path.join('pngs').to_s,
|
||||
:html_png_url => '../files/pngs/',
|
||||
:html_png_url => @content.options[:png_url],
|
||||
:content_only => true,
|
||||
:author => @content.options[:engine_opts][:author],
|
||||
:title => @content.options[:engine_opts][:title]})
|
||||
|
@ -104,7 +104,7 @@ module Engines
|
|||
:html_math_output_png => true,
|
||||
:html_png_engine => 'blahtex',
|
||||
:html_png_dir => @content.web.files_path.join('pngs').to_s,
|
||||
:html_png_url => '../files/pngs/'}).to_html
|
||||
:html_png_url => @content.options[:png_url]}).to_html
|
||||
html.gsub(/\A<div class="maruku_wrapper_div">\n?(.*?)\n?<\/div>\Z/m, '\1')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,6 +7,8 @@ class AbstractUrlGenerator
|
|||
@controller = controller
|
||||
end
|
||||
|
||||
attr :controller
|
||||
|
||||
# Create a link for the given page (or file) name and link text based
|
||||
# on the render mode in options and whether the page (file) exists
|
||||
# in the web.
|
||||
|
|
|
@ -143,6 +143,12 @@ class WikiContent < String
|
|||
@options[:active_chunks] = (ACTIVE_CHUNKS - [WikiChunk::Word] ) if @web.brackets_only?
|
||||
@options[:hide_chunks] = (HIDE_CHUNKS - [Literal::Math] ) unless
|
||||
[Engines::MarkdownMML, Engines::MarkdownPNG].include?(@options[:engine])
|
||||
if @options[:engine] == Engines::MarkdownPNG
|
||||
@options[:png_url] =
|
||||
@options[:mode] == :export ? 'files/pngs/' :
|
||||
(@url_generator.controller.url_for :controller => 'file', :web => @web.address,
|
||||
:action => 'file', :id => 'pngs', :only_path => true) + '/'
|
||||
end
|
||||
|
||||
@not_rendered = @pre_rendered = nil
|
||||
|
||||
|
|
|
@ -104,9 +104,13 @@ end
|
|||
class StubUrlGenerator < AbstractUrlGenerator
|
||||
|
||||
def initialize
|
||||
super(:doesnt_need_controller)
|
||||
controller = Object.new
|
||||
def controller.url_for(options = {})
|
||||
'../files/pngs'
|
||||
end
|
||||
super(controller)
|
||||
end
|
||||
|
||||
|
||||
def file_link(mode, name, text, web_name, known_file, description)
|
||||
link = CGI.escape(name)
|
||||
case mode
|
||||
|
|
Loading…
Reference in a new issue