Use Standard PageRenderer for S5 Content
From Jason Blevins: use the standard PageRenderer class to render S5 content. This way, WikiWords (etc) are processed in S5 slideshows.
This commit is contained in:
parent
3f5d804c22
commit
54aada824c
4 changed files with 48 additions and 19 deletions
|
@ -42,9 +42,20 @@ module Engines
|
|||
def mask
|
||||
require 'maruku'
|
||||
require 'maruku/ext/math'
|
||||
html = sanitize_rexml(Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
|
||||
{:math_enabled => false}).to_html_tree)
|
||||
html.gsub(/\A<div class="maruku_wrapper_div">\n?(.*?)\n?<\/div>\Z/m, '\1')
|
||||
|
||||
# If the request is for S5, call Maruku accordingly (without math)
|
||||
if @content.options[:mode] == :s5
|
||||
my_content = Maruku.new(@content.delete("\r"), {:math_enabled => false,
|
||||
:content_only => true,
|
||||
:author => @content.options[:engine_opts][:author],
|
||||
:title => @content.options[:engine_opts][:title]})
|
||||
@content.options[:renderer].s5_theme = my_content.s5_theme
|
||||
sanitize_xhtml(my_content.to_s5)
|
||||
else
|
||||
sanitize_rexml(Maruku.new(@content.delete("\r"),
|
||||
{:math_enabled => false}).to_html_tree)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -54,9 +65,23 @@ module Engines
|
|||
def mask
|
||||
require 'maruku'
|
||||
require 'maruku/ext/math'
|
||||
html = sanitize_rexml(Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
|
||||
{:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}']}).to_html_tree)
|
||||
html.gsub(/\A<div class="maruku_wrapper_div">\n?(.*?)\n?<\/div>\Z/m, '\1')
|
||||
|
||||
# If the request is for S5, call Maruku accordingly
|
||||
if @content.options[:mode] == :s5
|
||||
my_content = Maruku.new(@content.delete("\r"), {:math_enabled => true,
|
||||
:math_numbered => ['\\[','\\begin{equation}'],
|
||||
:content_only => true,
|
||||
:author => @content.options[:engine_opts][:author],
|
||||
:title => @content.options[:engine_opts][:title]})
|
||||
@content.options[:renderer].s5_theme = my_content.s5_theme
|
||||
sanitize_xhtml(my_content.to_s5)
|
||||
else
|
||||
html = sanitize_rexml(Maruku.new(@content.delete("\r"),
|
||||
{:math_enabled => true,
|
||||
:math_numbered => ['\\[','\\begin{equation}']}).to_html_tree)
|
||||
html.gsub(/\A<div class="maruku_wrapper_div">\n?(.*?)\n?<\/div>\Z/m, '\1')
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue