Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
a14db81b79
|
@ -1,7 +1,7 @@
|
|||
# Controller responsible for serving files and pictures.
|
||||
|
||||
require 'zip/zip'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
class FileController < ApplicationController
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'fileutils'
|
|||
require 'maruku'
|
||||
require 'maruku/ext/math'
|
||||
require 'zip/zip'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
require 'resolv'
|
||||
|
||||
class WikiController < ApplicationController
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# The methods added to this helper will be available to all templates in the application.
|
||||
module ApplicationHelper
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
# Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container
|
||||
# where the elements respond to first and last (such as a two-element array), the "lasts" serve as option values and
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Allow the metal piece to run in isolation
|
||||
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
|
||||
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
class Itex
|
||||
def self.call(env)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'chunks/chunk'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
# The category chunk looks for "category: news" on a line by
|
||||
# itself and parses the terms after the ':' as categories.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$: << File.dirname(__FILE__) + "../../lib"
|
||||
|
||||
require_dependency 'chunks/chunk'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
require 'maruku'
|
||||
require 'maruku/ext/math'
|
||||
require_dependency 'rdocsupport'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'chunks/chunk'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
# Contains all the methods for finding and replacing wiki related links.
|
||||
module WikiChunk
|
||||
|
|
|
@ -7,7 +7,7 @@ module Sanitizer
|
|||
|
||||
require 'action_controller/vendor/html-scanner/html/tokenizer'
|
||||
require 'node'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
require 'set'
|
||||
|
||||
acceptable_elements = Set.new %w[a abbr acronym address area article aside
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
class AbstractUrlGenerator
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ require_dependency 'chunks/wiki'
|
|||
require_dependency 'chunks/literal'
|
||||
require 'chunks/nowiki'
|
||||
require 'sanitizer'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
|
||||
# Wiki content is just a string that can process itself with a chain of
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#coding: utf-8
|
||||
# Contains all the methods for finding and replacing wiki words
|
||||
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
module WikiWords
|
||||
# In order of appearance: Latin, greek, cyrillic, armenian
|
||||
|
|
|
@ -10,7 +10,7 @@ require 'wiki_controller'
|
|||
require 'rexml/document'
|
||||
require 'tempfile'
|
||||
require 'zip/zipfilesystem'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
# Raise errors beyond the default web-based presentation
|
||||
class WikiController; def rescue_action(e) logger.error(e); raise e end; end
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
require File.expand_path(File.join(File.dirname(__FILE__), '/../test_helper'))
|
||||
require 'sanitizer'
|
||||
require 'json'
|
||||
require 'stringsupport'
|
||||
require 'instiki_stringsupport'
|
||||
|
||||
class SanitizerTest < Test::Unit::TestCase
|
||||
|
||||
|
|
|
@ -3,8 +3,18 @@ module MaRuKu
|
|||
module HTML
|
||||
def convert_to_mathml_itex2mml(kind, tex)
|
||||
return if $already_warned_itex2mml
|
||||
begin
|
||||
require 'itextomml'
|
||||
require 'stringsupport'
|
||||
rescue LoadError => e
|
||||
maruku_error "Could not load package 'itex2mml'.\nPlease install it." unless $already_warned_itex2mml
|
||||
$already_warned_itex2mml = true
|
||||
return nil
|
||||
end
|
||||
begin
|
||||
require 'itex_stringsupport'
|
||||
rescue LoadError
|
||||
require 'instiki_stringsupport'
|
||||
end
|
||||
|
||||
parser = Itex2MML::Parser.new
|
||||
mathml =
|
||||
|
@ -17,11 +27,6 @@ module MaRuKu
|
|||
end
|
||||
|
||||
return Document.new(mathml.to_utf8, :respect_whitespace => :all).root
|
||||
rescue LoadError => e
|
||||
# TODO: Properly scope this global
|
||||
maruku_error "Could not load package 'itex2mml'.\nPlease install it." unless $already_warned_itex2mml
|
||||
$already_warned_itex2mml = true
|
||||
nil
|
||||
rescue REXML::ParseException => e
|
||||
maruku_error "Invalid MathML TeX: \n#{tex.gsub(/^/, 'tex>')}\n\n #{e.inspect}"
|
||||
nil
|
||||
|
|
|
@ -6,6 +6,11 @@ module MaRuKu; module Out; module HTML
|
|||
# or return an empty array on error
|
||||
# return []
|
||||
# or have a string parsed by REXML:
|
||||
begin
|
||||
require 'itex_stringsupport'
|
||||
rescue LoadError
|
||||
require 'instiki_stringsupport'
|
||||
end
|
||||
tex = tex.escapeHTML
|
||||
mathml = "<code>#{tex}</code>"
|
||||
return Document.new(mathml).root
|
||||
|
|
Loading…
Reference in a new issue