Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 184
- Log:
Get rid of RedCloth 3.0.3 insistence; Arachsys includes this
centrally now, after everyone discovered how broken 3.0.4 was.
Don't request hard breaks - RedCloth screws up badly. I2
Textile markup now works as well as any of the other apps.
- Author:
- rool
- Date:
- Sun Mar 25 19:28:46 +0100 2007
- Size:
- 1772 Bytes
1 | require 'html_diff/lib/html_diff' |
2 | |
3 | module ApplicationHelper |
4 | def nlink_to(name, options = {}, html_options = {}, *parameters_for_method_reference) |
5 | link_to(name, options, html_options.update(:class => "navlink"), *parameters_for_method_reference) |
6 | end |
7 | |
8 | def page_title |
9 | if @page && (@page.title == 'Home Page') && (%w( show published print ).include?(@controller.action_name)) |
10 | @book.name |
11 | elsif @book |
12 | "#{@title} in #{@book.name}" |
13 | else |
14 | @title |
15 | end |
16 | end |
17 | |
18 | def page_heading |
19 | if @page && (@page.title == 'Home Page') && (%w( show published print ).include?(@controller.action_name)) |
20 | @book.name |
21 | elsif @book |
22 | link_to(@book.name + ':', :controller => '/') + ' ' + @title |
23 | else |
24 | @title |
25 | end |
26 | end |
27 | |
28 | def markup(body, existing_page_titles = @book.existing_page_titles) |
29 | # require 'redcloth303' # Use local, specific version in 'lib' |
30 | text = linkize(auto_link(body), existing_page_titles) |
31 | # textilized = RedCloth.new(text, [ :hard_breaks ]) |
32 | # textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=") |
33 | # textilized.to_html |
34 | RedCloth.new(text).to_html |
35 | end |
36 | |
37 | def differences(original, new) |
38 | HTMLDiff.diff(original, new) |
39 | end |
40 | |
41 | def link_to_author(author) |
42 | link_to(author.name, page_url(:page_title => author)) + " (#{author.ip})" |
43 | end |
44 | |
45 | private |
46 | def linkize(body, existing_titles) |
47 | body.gsub(Version::PAGE_LINK) do |
48 | page = title = $1 |
49 | title = $2 unless $2.empty? |
50 | if existing_titles.include?(page) |
51 | link_to(title, page_url(:page_title => page), :class => "existingWikiWord") |
52 | else |
53 | content_tag("span", title + link_to("?", page_url(:page_title => page)), :class => "newWikiWord") |
54 | end |
55 | end |
56 | end |
57 | end |