Don't hide equations, except in MarkdownMML and MarkdownPNG

In other engines, e.g. textile, the equation delimiters have no
special meaning. So they should not be used to hide content from
wiki processing.
This commit is contained in:
Jacques Distler 2009-01-16 12:51:43 -06:00
parent a6d80426a9
commit 294ac909c4
2 changed files with 13 additions and 1 deletions

View file

@ -120,6 +120,7 @@ class WikiContent < String
DEFAULT_OPTS = {
:active_chunks => ACTIVE_CHUNKS,
:hide_chunks => HIDE_CHUNKS,
:engine => Engines::MarkdownMML,
:engine_opts => [],
:mode => :show
@ -138,6 +139,8 @@ class WikiContent < String
@options[:engine] = Engines::MAP[@web.markup]
@options[:engine_opts] = [:filter_html, :filter_styles] if @web.safe_mode?
@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])
@not_rendered = @pre_rendered = nil
@ -169,7 +172,7 @@ class WikiContent < String
copy = WikiContentStub.new(self, @web, @options)
@options[:engine].apply_to(copy)
copy.inside_chunks(HIDE_CHUNKS) do |id|
copy.inside_chunks(@options[:hide_chunks]) do |id|
@chunks_by_id[id.to_i].revert
end
end