diff --git a/gollum.gemspec b/gollum.gemspec index 1a357082..cd2e7608 100644 --- a/gollum.gemspec +++ b/gollum.gemspec @@ -5,8 +5,8 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 1.8.7" s.name = 'gollum' - s.version = '2.2.9' - s.date = '2012-10-14' + s.version = '2.3.0' + s.date = '2012-10-18' s.rubyforge_project = 'gollum' s.summary = "A simple, Git-powered wiki." @@ -27,7 +27,6 @@ Gem::Specification.new do |s| s.add_dependency('github-markup', ['>= 0.7.4', '< 1.0.0']) s.add_dependency('github-markdown', '~> 0.5.1') s.add_dependency('pygments.rb', '~> 0.3.2') - s.add_dependency('escape_utils', '0.2.4') s.add_dependency('sinatra', '~> 1.3.3') s.add_dependency('mustache', ['>= 0.99.4', '< 1.0.0']) s.add_dependency('sanitize', '~> 2.0.3') @@ -458,7 +457,6 @@ Gem::Specification.new do |s| lib/gollum/page.rb lib/gollum/pagination.rb lib/gollum/sanitization.rb - lib/gollum/tex.rb lib/gollum/web_sequence_diagram.rb lib/gollum/wiki.rb licenses/css_tree_menu_thecssninja/license.txt @@ -470,4 +468,4 @@ Gem::Specification.new do |s| # = MANIFEST = s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ } -end \ No newline at end of file +end diff --git a/lib/gollum.rb b/lib/gollum.rb index d9a4f14f..449f801c 100644 --- a/lib/gollum.rb +++ b/lib/gollum.rb @@ -18,12 +18,11 @@ require File.expand_path('../gollum/file', __FILE__) require File.expand_path('../gollum/file_view', __FILE__) require File.expand_path('../gollum/markup', __FILE__) require File.expand_path('../gollum/sanitization', __FILE__) -require File.expand_path('../gollum/tex', __FILE__) require File.expand_path('../gollum/web_sequence_diagram', __FILE__) require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__) module Gollum - VERSION = '2.2.9' + VERSION = '2.3.0' def self.assets_path ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__)) diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb index e61047f9..8fed6937 100644 --- a/lib/gollum/markup.rb +++ b/lib/gollum/markup.rb @@ -33,7 +33,6 @@ module Gollum @dir = ::File.dirname(page.path) @tagmap = {} @codemap = {} - @texmap = {} @wsdmap = {} @premap = {} @toc = nil @@ -57,7 +56,6 @@ module Gollum data = extract_metadata(data) data = extract_gitcode(data) data = extract_code(data) - data = extract_tex(data) data = extract_wsd(data) data = extract_tags(data) begin @@ -79,7 +77,6 @@ module Gollum data = doc.to_xhtml data = process_toc_tags(data) - data = process_tex(data) data = process_wsd(data) data.gsub!(/

<\/p>/) do '' @@ -126,47 +123,6 @@ module Gollum [doc, toc] end - ######################################################################### - # - # TeX - # - ######################################################################### - - # Extract all TeX into the texmap and replace with placeholders. - # - # data - The raw String data. - # - # Returns the placeholder'd String data. - def extract_tex(data) - data.gsub(/\\\[\s*(.*?)\s*\\\]/m) do - tag = CGI.escapeHTML($1) - id = Digest::SHA1.hexdigest(tag) - @texmap[id] = [:block, tag] - id - end.gsub(/\\\(\s*(.*?)\s*\\\)/m) do - tag = CGI.escapeHTML($1) - id = Digest::SHA1.hexdigest(tag) - @texmap[id] = [:inline, tag] - id - end - end - - # Process all TeX from the texmap and replace the placeholders with the - # final markup. - # - # data - The String data (with placeholders). - # - # Returns the marked up String data. - def process_tex(data) - @texmap.each do |id, spec| - type, tex = *spec - data.gsub!(id) do - Gollum::Tex.to_html(tex, type) - end - end - data - end - ######################################################################### # # Tags diff --git a/lib/gollum/tex.rb b/lib/gollum/tex.rb deleted file mode 100644 index 5612b116..00000000 --- a/lib/gollum/tex.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'escape_utils' - -module Gollum - module Tex - TEX_URL = "http://www.mathtran.org/cgi-bin/toy/" - TEX_SIZES = { :inline => 2, :block => 4 } - - def self.to_html(tex, type = :inline) - tex_uri = EscapeUtils.escape_uri(tex) - tex_alt = EscapeUtils.escape_html(tex) - %{#{tex_alt}} - end - end -end diff --git a/test/test_markup.rb b/test/test_markup.rb index 7be218de..9dc477fd 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -758,24 +758,6 @@ end ] end - ######################################################################### - # - # TeX - # - ######################################################################### - - test "TeX block syntax" do - content = 'a \[ a^2 \] b' - output = "

ab

" - compare(content, output, 'md') - end - - test "TeX inline syntax" do - content = 'a \( a^2 \) b' - output = "

ab

" - compare(content, output, 'md') - end - ######################################################################### # Asciidoc #########################################################################