Commit graph

72 commits

Author SHA1 Message Date
Jacques Distler 2d303d54a0 Better text/html serialization
For the Andrew Staceys of this world:
deal with empty element in a more
text/html-friendly fashion.
2011-08-27 02:40:40 -05:00
Jacques Distler 903c4b6bdd Pre Chunk-Handler gets confused when XML parser converts empty elements to short-tag syntax.
Reported by Andrew Stacey.
2011-08-23 14:35:27 -05:00
Jacques Distler 3c650f2cf6 StringScanner is not multibyte-safe. Avoid like the plague. 2011-08-15 10:18:18 -05:00
Jacques Distler 13a522525c REXML is dead. Long live Nokogiri.
Modify Maruku to use Nokogiri instead of REXML.
Produces a 3-fold speedup in the #to_html method.
2011-08-11 20:36:44 -05:00
Jacques Distler 2967b207b2 Update for itex2MML 1.4.6 2011-07-07 10:18:55 -05:00
Jacques Distler 8b008f8418 Fix Maruku Footnote Backlink
Problem reported by Shamaoke.
2011-06-18 15:54:32 -05:00
Jacques Distler 9e909d5be3 Update Rails, rails_xss and Bundler
Update Bundler to 1.0.15.
Update Rails to 2.3.12.
Update rails_xss plugin.

The latter two were the
source of a considerable
amount of grief, as rails_xss
is now MUCH stricter about what
string methods can be used.

Also made it possible to use
rake 0.9.x with Instiki. But
you probably REALLY want to use

 ruby bundle exec rake ...

instead of just saying

 rake ....
2011-06-15 00:43:38 -05:00
Jacques Distler 79a966f71f Fix Ordered Lists
Fix a regression in Maruku.
(Reported by Andrew Stacey.)
2011-06-09 08:30:23 -05:00
Jacques Distler c9ad2c0c6e Non-ASCII Lists
Fix a bug in Maruku's
list-parsing.

Also fix a test broken
by latest Rack + Ruby 1.9.
2011-06-01 13:17:23 -05:00
Jacques Distler f914a40fa9 Fix Maruku Math Bug
Reported by Andrew Stacey.
2010-11-27 00:43:22 -06:00
Jacques Distler 4be1a58a24 Update RedCloth to 4.x
Use Bundler to manage RedCloth
gem. 4.x should be much faster
and less buggy. Unfortunately,
it doesn't support mixed
Textile/Markdown syntax. So
we keep an (appropriately
renamed) copy of 3.x around,
for the users of the "Mixed"
text filter.
2010-11-03 23:32:55 -05:00
Jacques Distler bb17fbbe02 Included pages
Redirects and categories of included
pages should not be inherited.
(Suggestion of Andrew Stacey)
2010-10-21 23:58:04 -05:00
Jacques Distler ef30cc22df Update to Rails 2.3.9 and itextomml 1.3.27 2010-09-05 15:24:15 -05:00
Jacques Distler b3aae9b06d Sqlite3-ruby 1.3.1, itextomml 1.3.26
Update vendored sqlite3-ruby and tests
for latest itextmml.
2010-07-20 20:36:17 -05:00
Jacques Distler 6491d70326 Update Vendored Rack to 1.2.0
Also update tests for itextomml 1.3.25.
2010-06-13 23:09:24 -05:00
Jacques Distler ad7e32c92c Tests for Revision 644 2010-06-01 09:22:37 -05:00
Jacques Distler e3aa626489 Better Display of Interweb Wikilinks
Perhaps not the most creative use of CSS. But,
at least, this will read better.
2010-01-03 13:19:47 -06:00
Jacques Distler e3832c6f79 Rails 2.3.5
Upgrade to Rails 2.3.5.
Also work around this bug:
 https://rails.lighthouseapp.com/projects/8994/tickets/3524
created by the aforementioned
Rails release.
2009-11-30 19:38:34 -06:00
Jacques Distler a6429f8c22 Ruby 1.9 Compatibility
Completely removed the html5lib sanitizer.
Fixed the string-handling to work in both
Ruby 1.8.x and 1.9.2. There are still,
inexplicably, two functional tests that
fail. But the rest seems to work quite well.
2009-11-30 16:28:18 -06:00
Jacques Distler b1b988c672 Update Test for itex2MML 1.3.18
More entity fun.
2009-11-18 12:44:25 -06:00
Jacques Distler 371aab6f96 Sync with Latest itex2MML and MathML::Entities
Support the latest changes in
http://www.w3.org/TR/2009/WD-xml-entity-names-20091117/
2009-11-18 12:04:07 -06:00
Jacques Distler 977da29f68 Support for \tooltip{}{} and \statusline{}{}
itex2MML 1.3.16 add a \tooltip{}{} command which,
like \statusline{}{}, produces an <maction> element.

Neither of these is natively supported by Mozilla/Firefox.
Add some Javascript to work around that weakness.
2009-11-06 14:32:45 -06:00
Jacques Distler d14db51d9e More Sanitizer Refactoring
Make the Sanitizer more efficient.
Also, update some unit tests.
2009-10-09 23:18:17 -05:00
Jacques Distler d89769fe81 Update for itex2MML 1.3.13
Implements \mathrlap{}, \mathllap{}, and \mathclap{}.
Deprecates the use of \rlap{} (use \mathrlap{}, instead:
the latter works in math-mode in the LaTeX export, whereas
TeX's \rlap{} did not).
2009-10-05 02:36:00 -05:00
Jacques Distler 41274d64d0 Support itex2MML 1.3.12 2009-10-04 03:46:06 -05:00
Jacques Distler affc47fc22 Fix TeX Rendering Bug
Make sure we

  require 'maruku/ext/math'

before calling the Maruku#to_latex method.

Also, update test for itex2MML 1.3.11 .
2009-09-13 11:23:57 -05:00
Jacques Distler 336e57d6b4 Pathname Objects
Web#files_path and Web#blatex_pngs_path now return Pathname objects.
Based on JHerdman's
5d1e8f420b
but requires several other changes to the code (which assumed a string).

Also, test for itex2MML 1.3.10 (you should update that too).
2009-08-28 11:10:34 -05:00
Jacques Distler 329fafafce Fix Two bugs from Toby Bartels
1. Ensure that "rollback" respects locked pages.
2. Expire revisions of an edited page. Use a before_save
   hook to deal with the situation where a page's name
   has been changed.
2009-08-04 00:02:04 -05:00
Jacques Distler 77e00f1a76 Test for itex2MML 1.3.9
Make sure we have the latest itex2MML.
2009-07-09 15:40:45 -05:00
Jacques Distler 305b37b401 Another Bug-fix and some tests
Man, but this needs more tests ... !
2009-06-06 21:08:08 -05:00
Jacques Distler 0943b7e510 Expire Caches for Redirected Links
[[!redirect foo]] should expire all pages which reference "foo".
Sounds simple, but this was a really gnarly bug to fix.
2009-06-05 00:39:12 -05:00
Jacques Distler 634f635f16 Update one Unit Test
To match the new behaviour of Revision 387.
2009-05-13 01:44:47 -05:00
Jacques Distler c85ce458ce Update for itex2MML 1.38
Add support, in the LaTeX export, for blackboard bold
digits and lowercase latin letters. If these are
present, LaTeX will
   \usepackage{mathbbol}
N.B.: this uses the stmaryrd font for blackboard bold
letters, instead of the msbm font.
Tests included. (Yes, you need to update itex2MML as well.)
2009-03-24 22:37:58 -05:00
Jacques Distler 801d307405 BlahTeX Tests
Commit some basic tests for the BlahTeX support.
I hope Ari Stern comes up with a more comprehensive
test suite.
2009-03-10 00:15:03 -05:00
Jacques Distler 79be69c910 Update Tests for Latest itex2MML
In particular, we (going forward) will have a unit test which
will determine whether the latest itex2MML is installed.
2009-03-08 23:29:06 -05:00
Jacques Distler d8a2a3657d Tests
Add tests for x-sendfile, <audio> and <video> support.
2009-03-03 22:27:26 -06:00
Jacques Distler 4e14ccc74d Instiki 0.16.3: Rails 2.3.0
Instiki now runs on the Rails 2.3.0 Candidate Release.
Among other improvements, this means that it now 
automagically selects between WEBrick and Mongrel.

Just run

    ./instiki --daemon
2009-02-04 14:26:08 -06:00
Jacques Distler 5d15e3f39d Security: Instiki 0.16.2
On Webs with file uploads enabled, uploaded files were stored
(in version 0.16.1 and earlier) in the public/ directory.

This was a security threat. A miscreant could upload a .html file.
When a user clicked on the link to the file, it was opened (unsanitized)
in the browser.

As of version 0.16.2, uploaded files are stored in the webs/
directory. Now, when the user clicks on the link, the file is sent
with the

    Content-Disposition: attachment

header set, which causes the file to be downloaded, rather than opened
in the browser. As always, files downloaded from the internets should be
treated with caution. At least, this way, they are not aoutomatically 
opened in the browser.

To move your existing uploaded files to the new location, do a

     rake upgrade_instiki
2009-01-26 00:21:30 -06:00
Jacques Distler 294ac909c4 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.
2009-01-16 12:51:43 -06:00
Jacques Distler 41006d20ef Fix the "Backslashes in Included Equations" Bug
See
  http://golem.ph.utexas.edu/instiki/revision/Known+Bugs?rev=3#IncludedEqs

Who knew that

      @pre_rendered = String.new(self)

was not the same as

      @pre_rendered = String.new
      @pre_rendered = self

?
2009-01-14 22:55:59 -06:00
Jacques Distler 074711d4c5 Hide Equations From WikiChunk Processing
WikiWord (and the like) could wreak havoc in equations. Protect them
(the way <a>, <pre> and <code> blocks are protected).

For some reason, this doesn't seem to work in inline equations.
Maruku is doing something funny there ... => one failing Unit Test.
2009-01-14 16:11:07 -06:00
Jacques Distler 39348c65c2 Make Andrea Happy
Use a counter, instead of rand() to aid in generating unique IDs in Maruku.
Add Unit test for the Theorem Environment.
2008-10-25 00:52:59 -05:00
Jacques Distler e48b000c11 Tweak from Ari Stern
Match Maruku Revision 184: change wrapper for embedded TeX in display equation from
a <div> to a <span>.
2008-10-23 22:44:53 -05:00
Jacques Distler 34082fbf94 Theorem Environments
Implement amsthm-like Theorem environments with Maruku.
Support is based on Maruku "div"s with special class-names.
Classes
    num_*
produce numbered environments, and

    un_*

produce un-numbered environments, where * is one of

   theorem     (for Theorem)
   lemma       (for Lemma)
   prop        (for Proposition)
   cor         (for Corollary)
   def         (for Definition)
   example     (for Example)
   remark      (for Remark)
   note        (for Note)

In addition, the class

   proof

produces a Proof environment.

The LaTeX export works as expected, and these also work in the S5 view.

Bumped version number.
2008-10-17 16:26:17 -05:00
Jacques Distler ca1e8de89c Minor Cleanups
Remove a no-longer-needed function.
&apos; -> &39;
Fix regexp for tag chunk.
2008-05-22 02:46:45 -05:00
Jacques Distler f6508de6dd Whoops!
In some circumstances, the new Sanitizer was double-escaping text nodes.
Fixed (with unit test).
2008-05-21 14:14:43 -05:00
Jacques Distler 45405fc97e New Sanitizer Goes Live
The new sanitizer seems to work well (cuts the time required
to produce the Instiki Atom feed in half). Our strategy is to
use HTML5lib for <nowiki> content, but to use the new sanitizer
for content that has been processed by Maruku (and hence is
well-formed).

The one broken unit test won't affect us (since it dealt with
very malformed HTML).
2008-05-21 02:06:31 -05:00
Jacques Distler 800880f382 Rough In New Sanitizer
Start work (which may not pan out) on a new sanitizer. Right now, it passes
all but 1 of the HTML5lib Sanitizer's unit tests. But it doesn't do much
of anything to ensure well-formedness. This is not an issue for Maruku-processed
content, but it is a concern for <nowiki> blocks.

(One solution would be to use the HTML5lib parser on <nowiki> blocks.)

In any case, this baby is 3 times as fast as the HTML5lib sanitizer.
2008-05-20 17:02:10 -05:00
Jacques Distler 14afed5893 Test for Entity-handling 2008-05-17 15:02:16 -05:00
Jacques Distler 41346bf8bd Efficiency: Entity handling
Previously, used a regexp to find and convert named entities in the content.
Now use a more efficient algorithm.
Similar tweak for converting NCRs before checking whether text is valid utf-8.
2008-05-17 01:43:11 -05:00