Skip to content
Browse files

Removed old vendored RedCloth in favour of gem.

  • Loading branch information...
1 parent 4d92663 commit e36a0db44f02a21d3d407eb264393d58437092eb Mark Dunkley committed Sep 3, 2009
View
4 config/environment.rb
@@ -15,7 +15,9 @@
config.frameworks -= [ :action_web_service ]
# Add additional load paths for your own custom dirs
- config.load_paths += %W( #{RAILS_ROOT}/vendor/RedCloth-3.0.3/lib )
+ # config.load_paths += %W( #{RAILS_ROOT}/vendor/RedCloth-3.0.3/lib )
+
+ config.gem "RedCloth", :version => '= 4.2.0'
# config.controller_paths += %W( #{RAILS_ROOT}/vendor/plugins/routing_navigator/lib )
View
5 lib/extensions/string_ext.rb
@@ -0,0 +1,5 @@
+class String
+ def to_html
+ RedCloth.new(self).to_html
+ end
+end
View
18 test/test_helper.rb
@@ -1,8 +1,9 @@
ENV["RAILS_ENV"] = "test"
-require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+require File.expand_path(File.dirname(__FILE__) + '/../config/environment')
require 'test_help'
-class Test::Unit::TestCase
+class ActiveSupport::TestCase
+ fixtures :all
# Transactional fixtures accelerate your tests by wrapping each test method
# in a transaction that's rolled back on completion. This ensures that the
# test database remains unchanged so your fixtures don't have to be reloaded
@@ -23,17 +24,4 @@ class Test::Unit::TestCase
# instantiated fixtures translates to a database query per test method),
# then set this back to true.
self.use_instantiated_fixtures = false
-
-
- # Add more helper methods to be used by all tests here...
- def assert_difference(object, method, difference)
- initial_value = object.send(method)
- yield
- assert_equal initial_value + difference, object.send(method), "#{object}##{method}"
- end
-
- def assert_no_difference(object, method, &block)
- assert_difference object, method, 0, &block
- end
-
end
View
7 test/unit/category_test.rb
@@ -1,9 +1,6 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
-class CategoryTest < Test::Unit::TestCase
- fixtures :categories
-
- # Replace this with your real tests.
+class CategoryTest < ActiveSupport::TestCase
def test_truth
assert_kind_of Category, categories(:first)
end
View
5 test/unit/forum_test.rb
@@ -1,9 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
-class ForumTest < Test::Unit::TestCase
- fixtures :forums
-
- # Replace this with your real tests.
+class ForumTest < ActiveSupport::TestCase
def test_true
true
end
View
5 test/unit/image_test.rb
@@ -1,9 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
-class ImageTest < Test::Unit::TestCase
- fixtures :images
-
- # Replace this with your real tests.
+class ImageTest < ActiveSupport::TestCase
def test_truth
assert true
end
View
14 test/unit/post_test.rb
@@ -1,16 +1,14 @@
require File.dirname(__FILE__) + '/../test_helper'
-class PostTest < Test::Unit::TestCase
- fixtures :posts
-
+class PostTest < ActiveSupport::TestCase
def test_create
- assert_difference Post, :count, +1 do
+ assert_difference 'Post.count' do
Post.create(:body => "lorem ipsum")
end
end
def test_script_tags
- assert_difference Post, :count, +1 do
+ assert_difference 'Post.count' do
@post = Post.new(:title => "Tag Test", :body => "<script>alert('hi')</script>")
@post.save
end
@@ -20,7 +18,7 @@ def test_script_tags
end
def test_pre_tags
- assert_difference Post, :count, +1 do
+ assert_difference('Post.count') do
@post = Post.new(:title => "Tag Test", :body => "<p><pre><anytag>text</anytag></pre></p>")
@post.save
end
@@ -30,7 +28,7 @@ def test_pre_tags
end
def test_surrounded_tags
- assert_difference Post, :count, +1 do
+ assert_difference 'Post.count' do
@post = Post.new(:title => "Tag Test", :body => "<script>alert('hi')</script><pre><anytag>text</anytag></pre><script>alert('hi')</script>")
@post.save
end
@@ -41,4 +39,4 @@ def test_surrounded_tags
-end
+end
View
2 test/unit/user_mailer_test.rb
@@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'user_mailer'
-class UserMailerTest < Test::Unit::TestCase
+class UserMailerTest < ActiveSupport::TestCase
FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
CHARSET = "utf-8"
View
5 test/unit/user_test.rb
@@ -1,9 +1,6 @@
require File.dirname(__FILE__) + '/../test_helper'
-class UserTest < Test::Unit::TestCase
- fixtures :users
-
- # Replace this with your real tests.
+class UserTest < ActiveSupport::TestCase
def test_truth
assert_kind_of User, users(:admin_hans)
end
View
3 vendor/RedCloth-3.0.3/bin/redcloth
@@ -1,3 +0,0 @@
-#!/usr/local/bin/ruby18
-require 'redcloth'
-puts RedCloth.new( ARGF.read ).to_html
View
1,113 vendor/RedCloth-3.0.3/lib/redcloth.rb
@@ -1,1113 +0,0 @@
-# vim:ts=4:sw=4:
-# = RedCloth - Textile and Markdown Hybrid for Ruby
-#
-# Homepage:: http://whytheluckystiff.net/ruby/redcloth/
-# Author:: why the lucky stiff (http://whytheluckystiff.net/)
-# Copyright:: (cc) 2004 why the lucky stiff (and his puppet organizations.)
-# License:: BSD
-#
-# (see http://hobix.com/textile/ for a Textile Reference.)
-#
-# Based on (and also inspired by) both:
-#
-# PyTextile: http://diveintomark.org/projects/textile/textile.py.txt
-# Textism for PHP: http://www.textism.com/tools/textile/
-#
-#
-
-# = RedCloth
-#
-# RedCloth is a Ruby library for converting Textile and/or Markdown
-# into HTML. You can use either format, intermingled or separately.
-# You can also extend RedCloth to honor your own custom text stylings.
-#
-# RedCloth users are encouraged to use Textile if they are generating
-# HTML and to use Markdown if others will be viewing the plain text.
-#
-# == What is Textile?
-#
-# Textile is a simple formatting style for text
-# documents, loosely based on some HTML conventions.
-#
-# == Sample Textile Text
-#
-# h2. This is a title
-#
-# h3. This is a subhead
-#
-# This is a bit of paragraph.
-#
-# bq. This is a blockquote.
-#
-# = Writing Textile
-#
-# A Textile document consists of paragraphs. Paragraphs
-# can be specially formatted by adding a small instruction
-# to the beginning of the paragraph.
-#
-# h[n]. Header of size [n].
-# bq. Blockquote.
-# # Numeric list.
-# * Bulleted list.
-#
-# == Quick Phrase Modifiers
-#
-# Quick phrase modifiers are also included, to allow formatting
-# of small portions of text within a paragraph.
-#
-# \_emphasis\_
-# \_\_italicized\_\_
-# \*strong\*
-# \*\*bold\*\*
-# ??citation??
-# -deleted text-
-# +inserted text+
-# ^superscript^
-# ~subscript~
-# @code@
-# %(classname)span%
-#
-# ==notextile== (leave text alone)
-#
-# == Links
-#
-# To make a hypertext link, put the link text in "quotation
-# marks" followed immediately by a colon and the URL of the link.
-#
-# Optional: text in (parentheses) following the link text,
-# but before the closing quotation mark, will become a Title
-# attribute for the link, visible as a tool tip when a cursor is above it.
-#
-# Example:
-#
-# "This is a link (This is a title) ":http://www.textism.com
-#
-# Will become:
-#
-# <a href="http://www.textism.com" title="This is a title">This is a link</a>
-#
-# == Images
-#
-# To insert an image, put the URL for the image inside exclamation marks.
-#
-# Optional: text that immediately follows the URL in (parentheses) will
-# be used as the Alt text for the image. Images on the web should always
-# have descriptive Alt text for the benefit of readers using non-graphical
-# browsers.
-#
-# Optional: place a colon followed by a URL immediately after the
-# closing ! to make the image into a link.
-#
-# Example:
-#
-# !http://www.textism.com/common/textist.gif(Textist)!
-#
-# Will become:
-#
-# <img src="http://www.textism.com/common/textist.gif" alt="Textist" />
-#
-# With a link:
-#
-# !/common/textist.gif(Textist)!:http://textism.com
-#
-# Will become:
-#
-# <a href="http://textism.com"><img src="/common/textist.gif" alt="Textist" /></a>
-#
-# == Defining Acronyms
-#
-# HTML allows authors to define acronyms via the tag. The definition appears as a
-# tool tip when a cursor hovers over the acronym. A crucial aid to clear writing,
-# this should be used at least once for each acronym in documents where they appear.
-#
-# To quickly define an acronym in Textile, place the full text in (parentheses)
-# immediately following the acronym.
-#
-# Example:
-#
-# ACLU(American Civil Liberties Union)
-#
-# Will become:
-#
-# <acronym title="American Civil Liberties Union">ACLU</acronym>
-#
-# == Adding Tables
-#
-# In Textile, simple tables can be added by seperating each column by
-# a pipe.
-#
-# |a|simple|table|row|
-# |And|Another|table|row|
-#
-# Attributes are defined by style definitions in parentheses.
-#
-# table(border:1px solid black).
-# (background:#ddd;color:red). |{}| | | |
-#
-# == Using RedCloth
-#
-# RedCloth is simply an extension of the String class, which can handle
-# Textile formatting. Use it like a String and output HTML with its
-# RedCloth#to_html method.
-#
-# doc = RedCloth.new "
-#
-# h2. Test document
-#
-# Just a simple test."
-#
-# puts doc.to_html
-#
-# By default, RedCloth uses both Textile and Markdown formatting, with
-# Textile formatting taking precedence. If you want to turn off Markdown
-# formatting, to boost speed and limit the processor:
-#
-# class RedCloth::Textile.new( str )
-
-class RedCloth < String
-
- VERSION = '3.0.3'
- DEFAULT_RULES = [:textile, :markdown]
-
- #
- # Two accessor for setting security restrictions.
- #
- # This is a nice thing if you're using RedCloth for
- # formatting in public places (e.g. Wikis) where you
- # don't want users to abuse HTML for bad things.
- #
- # If +:filter_html+ is set, HTML which wasn't
- # created by the Textile processor will be escaped.
- #
- # If +:filter_styles+ is set, it will also disable
- # the style markup specifier. ('{color: red}')
- #
- attr_accessor :filter_html, :filter_styles
-
- #
- # Accessor for toggling hard breaks.
- #
- # If +:hard_breaks+ is set, single newlines will
- # be converted to HTML break tags. This is the
- # default behavior for traditional RedCloth.
- #
- attr_accessor :hard_breaks
-
- #
- # Accessor for toggling span caps.
- #
- # Textile places `span' tags around capitalized
- # words by default, but this wreaks havoc on Wikis.
- # If +:no_span_caps+ is set, this will be
- # suppressed.
- #
- attr_accessor :no_span_caps
-
- #
- # Establishes the markup predence. Available rules include:
- #
- # == Textile Rules
- #
- # The following textile rules can be set individually. Or add the complete
- # set of rules with the single :textile rule, which supplies the rule set in
- # the following precedence:
- #
- # refs_textile:: Textile references (i.e. [hobix]http://hobix.com/)
- # block_textile_table:: Textile table block structures
- # block_textile_lists:: Textile list structures
- # block_textile_prefix:: Textile blocks with prefixes (i.e. bq., h2., etc.)
- # inline_textile_image:: Textile inline images
- # inline_textile_link:: Textile inline links
- # inline_textile_span:: Textile inline spans
- # inline_textile_glyphs:: Textile entities (such as em-dashes and smart quotes)
- #
- # == Markdown
- #
- # refs_markdown:: Markdown references (for example: [hobix]: http://hobix.com/)
- # block_markdown_setext:: Markdown setext headers
- # block_markdown_atx:: Markdown atx headers
- # block_markdown_rule:: Markdown horizontal rules
- # block_markdown_bq:: Markdown blockquotes
- # block_markdown_lists:: Markdown lists
- # inline_markdown_link:: Markdown links
- attr_accessor :rules
-
- # Returns a new RedCloth object, based on _string_ and
- # enforcing all the included _restrictions_.
- #
- # r = RedCloth.new( "h1. A <b>bold</b> man", [:filter_html] )
- # r.to_html
- # #=>"<h1>A &lt;b&gt;bold&lt;/b&gt; man</h1>"
- #
- def initialize( string, restrictions = [] )
- restrictions.each { |r| method( "#{ r }=" ).call( true ) }
- super( string )
- end
-
- #
- # Generates HTML from the Textile contents.
- #
- # r = RedCloth.new( "And then? She *fell*!" )
- # r.to_html( true )
- # #=>"And then? She <strong>fell</strong>!"
- #
- def to_html( *rules )
- rules = DEFAULT_RULES if rules.empty?
- # make our working copy
- text = self.dup
-
- @urlrefs = {}
- @shelf = []
- textile_rules = [:refs_textile, :block_textile_table, :block_textile_lists,
- :block_textile_prefix, :inline_textile_image, :inline_textile_link,
- :inline_textile_code, :inline_textile_glyphs, :inline_textile_span]
- markdown_rules = [:refs_markdown, :block_markdown_setext, :block_markdown_atx, :block_markdown_rule,
- :block_markdown_bq, :block_markdown_lists,
- :inline_markdown_reflink, :inline_markdown_link]
- @rules = rules.collect do |rule|
- case rule
- when :markdown
- markdown_rules
- when :textile
- textile_rules
- else
- rule
- end
- end.flatten
-
- # standard clean up
- incoming_entities text
- clean_white_space text
- no_textile text
-
- # start processor
- @pre_list = []
- rip_offtags text
- hard_break text
- refs text
- blocks text
- inline text
- smooth_offtags text
-
- retrieve text
-
- text.gsub!( /<\/?notextile>/, '' )
- text.gsub!( /x%x%/, '&#38;' )
- clean_html text if filter_html
- text.strip!
- text
-
- end
-
- #######
- private
- #######
- #
- # Mapping of 8-bit ASCII codes to HTML numerical entity equivalents.
- # (from PyTextile)
- #
- TEXTILE_TAGS =
-
- [[128, 8364], [129, 0], [130, 8218], [131, 402], [132, 8222], [133, 8230],
- [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249],
- [140, 338], [141, 0], [142, 0], [143, 0], [144, 0], [145, 8216], [146, 8217],
- [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732],
- [153, 8482], [154, 353], [155, 8250], [156, 339], [157, 0], [158, 0], [159, 376]].
-
- collect! do |a, b|
- [a.chr, ( b.zero? and "" or "&#{ b };" )]
- end
-
- #
- # Regular expressions to convert to HTML.
- #
- A_HLGN = /(?:(?:<>|<|>|\=|[()]+)+)/
- A_VLGN = /[\-^~]/
- C_CLAS = '(?:\([^)]+\))'
- C_LNGE = '(?:\[[^\]]+\])'
- C_STYL = '(?:\{[^}]+\})'
- S_CSPN = '(?:\\\\\d+)'
- S_RSPN = '(?:/\d+)'
- A = "(?:#{A_HLGN}?#{A_VLGN}?|#{A_VLGN}?#{A_HLGN}?)"
- S = "(?:#{S_CSPN}?#{S_RSPN}|#{S_RSPN}?#{S_CSPN}?)"
- C = "(?:#{C_CLAS}?#{C_STYL}?#{C_LNGE}?|#{C_STYL}?#{C_LNGE}?#{C_CLAS}?|#{C_LNGE}?#{C_STYL}?#{C_CLAS}?)"
- # PUNCT = Regexp::quote( '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' )
- PUNCT = Regexp::quote( '!"#$%&\'*+,-./:;=?@\\^_`|~' )
- HYPERLINK = '(\S+?)([^\w\s/;=\?]*?)(?=\s|<|$)'
-
- # Text markup tags, don't conflict with block tags
- SIMPLE_HTML_TAGS = [
- 'tt', 'b', 'i', 'big', 'small', 'em', 'strong', 'dfn', 'code',
- 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'a', 'img', 'br',
- 'br', 'map', 'q', 'sub', 'sup', 'span', 'bdo'
- ]
-
- # Elements to handle
- GLYPHS = [
- # [ /([^\s\[{(>])?\'([dmst]\b|ll\b|ve\b|\s|:|$)/, '\1&#8217;\2' ], # single closing
- [ /([^\s\[{(>])\'/, '\1&#8217;' ], # single closing
- [ /\'(?=\s|s\b|[#{PUNCT}])/, '&#8217;' ], # single closing
- [ /\'/, '&#8216;' ], # single opening
- # [ /([^\s\[{(])?"(\s|:|$)/, '\1&#8221;\2' ], # double closing
- [ /([^\s\[{(>])"/, '\1&#8221;' ], # double closing
- [ /"(?=\s|[#{PUNCT}])/, '&#8221;' ], # double closing
- [ /"/, '&#8220;' ], # double opening
- [ /\b( )?\.{3}/, '\1&#8230;' ], # ellipsis
- [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '<acronym title="\2">\1</acronym>' ], # 3+ uppercase acronym
- [ /(^|[^"][>\s])([A-Z][A-Z0-9 ]{2,})([^<a-z0-9]|$)/, '\1<span class="caps">\2</span>\3', :no_span_caps ], # 3+ uppercase caps
- [ /(\.\s)?\s?--\s?/, '\1&#8212;' ], # em dash
- [ /\s->\s/, ' &rarr; ' ], # right arrow
- [ /\s-\s/, ' &#8211; ' ], # en dash
- [ /(\d+) ?x ?(\d+)/, '\1&#215;\2' ], # dimension sign
- [ /\b ?[(\[]TM[\])]/i, '&#8482;' ], # trademark
- [ /\b ?[(\[]R[\])]/i, '&#174;' ], # registered
- [ /\b ?[(\[]C[\])]/i, '&#169;' ] # copyright
- ]
-
- H_ALGN_VALS = {
- '<' => 'left',
- '=' => 'center',
- '>' => 'right',
- '<>' => 'justify'
- }
-
- V_ALGN_VALS = {
- '^' => 'top',
- '-' => 'middle',
- '~' => 'bottom'
- }
-
- QTAGS = [
- ['**', 'b'],
- ['*', 'strong'],
- ['??', 'cite', :limit],
- ['-', 'del', :limit],
- ['__', 'i'],
- ['_', 'em', :limit],
- ['%', 'span', :limit],
- ['+', 'ins', :limit],
- ['^', 'sup'],
- ['~', 'sub']
- ]
- QTAGS.collect! do |rc, ht, rtype|
- rcq = Regexp::quote rc
- re =
- case rtype
- when :limit
- /(\W)
- (#{rcq})
- (#{C})
- (?::(\S+?))?
- (.+?)
- #{rcq}
- (?=\W)/x
- else
- /(#{rcq})
- (#{C})
- (?::(\S+?))?
- (.+?)
- #{rcq}/xm
- end
- [rc, ht, re, rtype]
- end
-
- #
- # Flexible HTML escaping
- #
- def htmlesc( str, mode )
- str.gsub!( '&', '&amp;' )
- str.gsub!( '"', '&quot;' ) if mode != :NoQuotes
- str.gsub!( "'", '&#039;' ) if mode == :Quotes
- str.gsub!( '<', '&lt;')
- str.gsub!( '>', '&gt;')
- end
-
- # Search and replace for Textile glyphs (quotes, dashes, other symbols)
- def pgl( text )
- GLYPHS.each do |re, resub, tog|
- next if tog and method( tog ).call
- text.gsub! re, resub
- end
- end
-
- # Parses Textile attribute lists and builds an HTML attribute string
- def pba( text_in, element = "" )
-
- return '' unless text_in
-
- style = []
- text = text_in.dup
- if element == 'td'
- colspan = $1 if text =~ /\\(\d+)/
- rowspan = $1 if text =~ /\/(\d+)/
- style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN
- end
-
- style << "#{ $1 };" if not filter_styles and
- text.sub!( /\{([^}]*)\}/, '' )
-
- lang = $1 if
- text.sub!( /\[([^)]+?)\]/, '' )
-
- cls = $1 if
- text.sub!( /\(([^()]+?)\)/, '' )
-
- style << "padding-left:#{ $1.length }em;" if
- text.sub!( /([(]+)/, '' )
-
- style << "padding-right:#{ $1.length }em;" if text.sub!( /([)]+)/, '' )
-
- style << "text-align:#{ h_align( $& ) };" if text =~ A_HLGN
-
- cls, id = $1, $2 if cls =~ /^(.*?)#(.*)$/
-
- atts = ''
- atts << " style=\"#{ style.join }\"" unless style.empty?
- atts << " class=\"#{ cls }\"" unless cls.to_s.empty?
- atts << " lang=\"#{ lang }\"" if lang
- atts << " id=\"#{ id }\"" if id
- atts << " colspan=\"#{ colspan }\"" if colspan
- atts << " rowspan=\"#{ rowspan }\"" if rowspan
-
- atts
- end
-
- TABLE_RE = /^(?:table(_?#{S}#{A}#{C})\. ?\n)?^(#{A}#{C}\.? ?\|.*?\|)(\n\n|\Z)/m
-
- # Parses a Textile table block, building HTML from the result.
- def block_textile_table( text )
- text.gsub!( TABLE_RE ) do |matches|
-
- tatts, fullrow = $~[1..2]
- tatts = pba( tatts, 'table' )
- tatts = shelve( tatts ) if tatts
- rows = []
-
- fullrow.
- split( /\|$/m ).
- delete_if { |x| x.empty? }.
- each do |row|
-
- ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m
-
- cells = []
- row.split( '|' ).each do |cell|
- ctyp = 'd'
- ctyp = 'h' if cell =~ /^_/
-
- catts = ''
- catts, cell = pba( $1, 'td' ), $2 if cell =~ /^(_?#{S}#{A}#{C}\. ?)(.*)/
-
- unless cell.strip.empty?
- catts = shelve( catts ) if catts
- cells << "\t\t\t<t#{ ctyp }#{ catts }>#{ cell }</t#{ ctyp }>"
- end
- end
- ratts = shelve( ratts ) if ratts
- rows << "\t\t<tr#{ ratts }>\n#{ cells.join( "\n" ) }\n\t\t</tr>"
- end
- "\t<table#{ tatts }>\n#{ rows.join( "\n" ) }\n\t</table>\n\n"
- end
- end
-
- LISTS_RE = /^([#*]+?#{C} .*?)$(?![^#*])/m
- LISTS_CONTENT_RE = /^([#*]+)(#{A}#{C}) (.*)$/m
-
- # Parses Textile lists and generates HTML
- def block_textile_lists( text )
- text.gsub!( LISTS_RE ) do |match|
- lines = match.split( /\n/ )
- last_line = -1
- depth = []
- lines.each_with_index do |line, line_id|
- if line =~ LISTS_CONTENT_RE
- tl,atts,content = $~[1..3]
- if depth.last
- if depth.last.length > tl.length
- (depth.length - 1).downto(0) do |i|
- break if depth[i].length == tl.length
- lines[line_id - 1] << "</li>\n\t</#{ lT( depth[i] ) }l>\n\t"
- depth.pop
- end
- end
- if depth.last.length == tl.length
- lines[line_id - 1] << '</li>'
- end
- end
- unless depth.last == tl
- depth << tl
- atts = pba( atts )
- atts = shelve( atts ) if atts
- lines[line_id] = "\t<#{ lT(tl) }l#{ atts }>\n\t<li>#{ content }"
- else
- lines[line_id] = "\t\t<li>#{ content }"
- end
- last_line = line_id
-
- else
- last_line = line_id
- end
- if line_id - last_line > 1 or line_id == lines.length - 1
- depth.delete_if do |v|
- lines[last_line] << "</li>\n\t</#{ lT( v ) }l>"
- end
- end
- end
- lines.join( "\n" )
- end
- end
-
- CODE_RE = /(\W)
- @
- (?:\|(\w+?)\|)?
- (.+?)
- @
- (?=\W)/x
-
- def inline_textile_code( text )
- text.gsub!( CODE_RE ) do |m|
- before,lang,code,after = $~[1..4]
- lang = " lang=\"#{ lang }\"" if lang
- rip_offtags( "#{ before }<code#{ lang }>#{ code }</code>#{ after }" )
- end
- end
-
- def lT( text )
- text =~ /\#$/ ? 'o' : 'u'
- end
-
- def hard_break( text )
- text.gsub!( /(.)\n(?! *[#*\s|]|$)/, "\\1<br />" ) if hard_breaks
- end
-
- BLOCKS_GROUP_RE = /\n{2,}(?! )/m
-
- def blocks( text, deep_code = false )
- text.replace( text.split( BLOCKS_GROUP_RE ).collect do |blk|
- plain = blk !~ /\A[#*> ]/
-
- # skip blocks that are complex HTML
- if blk =~ /^<\/?(\w+).*>/ and not SIMPLE_HTML_TAGS.include? $1
- blk
- else
- # search for indentation levels
- blk.strip!
- if blk.empty?
- blk
- else
- code_blk = nil
- blk.gsub!( /((?:\n(?:\n^ +[^\n]*)+)+)/m ) do |iblk|
- flush_left iblk
- blocks iblk, plain
- iblk.gsub( /^(\S)/, "\t\\1" )
- if plain
- code_blk = iblk; ""
- else
- iblk
- end
- end
-
- block_applied = 0
- @rules.each do |rule_name|
- block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( blk ) )
- end
- if block_applied.zero?
- if deep_code
- blk = "\t<pre><code>#{ blk }</code></pre>"
- else
- blk = "\t<p>#{ blk }</p>"
- end
- end
- # hard_break blk
- blk + "\n#{ code_blk }"
- end
- end
-
- end.join( "\n\n" ) )
- end
-
- def textile_bq( tag, atts, cite, content )
- cite, cite_title = check_refs( cite )
- cite = " cite=\"#{ cite }\"" if cite
- atts = shelve( atts ) if atts
- "\t<blockquote#{ cite }>\n\t\t<p#{ atts }>#{ content }</p>\n\t</blockquote>"
- end
-
- def textile_p( tag, atts, cite, content )
- atts = shelve( atts ) if atts
- "\t<#{ tag }#{ atts }>#{ content }</#{ tag }>"
- end
-
- alias textile_h1 textile_p
- alias textile_h2 textile_p
- alias textile_h3 textile_p
- alias textile_h4 textile_p
- alias textile_h5 textile_p
- alias textile_h6 textile_p
-
- def textile_fn_( tag, num, atts, cite, content )
- atts << " id=\"fn#{ num }\""
- content = "<sup>#{ num }</sup> #{ content }"
- atts = shelve( atts ) if atts
- "\t<p#{ atts }>#{ content }</p>"
- end
-
- BLOCK_RE = /^(([a-z]+)(\d*))(#{A}#{C})\.(?::(\S+))? (.*)$/m
-
- def block_textile_prefix( text )
- if text =~ BLOCK_RE
- tag,tagpre,num,atts,cite,content = $~[1..6]
- atts = pba( atts )
-
- # pass to prefix handler
- if respond_to? "textile_#{ tag }", true
- text.gsub!( $&, method( "textile_#{ tag }" ).call( tag, atts, cite, content ) )
- elsif respond_to? "textile_#{ tagpre }_", true
- text.gsub!( $&, method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content ) )
- end
- end
- end
-
- SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m
- def block_markdown_setext( text )
- if text =~ SETEXT_RE
- tag = if $2 == "="; "h1"; else; "h2"; end
- blk, cont = "<#{ tag }>#{ $1 }</#{ tag }>", $'
- blocks cont
- text.replace( blk + cont )
- end
- end
-
- ATX_RE = /\A(\#{1,6}) # $1 = string of #'s
- [ ]*
- (.+?) # $2 = Header text
- [ ]*
- \#* # optional closing #'s (not counted)
- $/x
- def block_markdown_atx( text )
- if text =~ ATX_RE
- tag = "h#{ $1.length }"
- blk, cont = "<#{ tag }>#{ $2 }</#{ tag }>\n\n", $'
- blocks cont
- text.replace( blk + cont )
- end
- end
-
- MARKDOWN_BQ_RE = /\A(^ *> ?.+$(.+\n)*\n*)+/m
-
- def block_markdown_bq( text )
- text.gsub!( MARKDOWN_BQ_RE ) do |blk|
- blk.gsub!( /^ *> ?/, '' )
- flush_left blk
- blocks blk
- blk.gsub!( /^(\S)/, "\t\\1" )
- "<blockquote>\n#{ blk }\n</blockquote>\n\n"
- end
- end
-
- MARKDOWN_RULE_RE = /^#{
- ['*', '-', '_'].collect { |ch| '( ?' + Regexp::quote( ch ) + ' ?){3,}' }.join( '|' )
- }$/
-
- def block_markdown_rule( text )
- text.gsub!( MARKDOWN_RULE_RE ) do |blk|
- "<hr />"
- end
- end
-
- # XXX TODO XXX
- def block_markdown_lists( text )
- end
-
- def inline_markdown_link( text )
- end
-
- def inline_textile_span( text )
- QTAGS.each do |qtag_rc, ht, qtag_re, rtype|
- text.gsub!( qtag_re ) do |m|
-
- case rtype
- when :limit
- sta,qtag,atts,cite,content = $~[1..5]
- else
- qtag,atts,cite,content = $~[1..4]
- sta = ''
- end
- atts = pba( atts )
- atts << " cite=\"#{ cite }\"" if cite
- atts = shelve( atts ) if atts
-
- "#{ sta }<#{ ht }#{ atts }>#{ content }</#{ ht }>"
-
- end
- end
- end
-
- LINK_RE = /
- ([\s\[{(]|[#{PUNCT}])? # $pre
- " # start
- (#{C}) # $atts
- ([^"]+?) # $text
- \s?
- (?:\(([^)]+?)\)(?="))? # $title
- ":
- (\S+?) # $url
- (\/)? # $slash
- ([^\w\/;]*?) # $post
- (?=<|\s|$)
- /x
-
- def inline_textile_link( text )
- text.gsub!( LINK_RE ) do |m|
- pre,atts,text,title,url,slash,post = $~[1..7]
-
- url, url_title = check_refs( url )
- title ||= url_title
-
- atts = pba( atts )
- atts = " href=\"#{ url }#{ slash }\"#{ atts }"
- atts << " title=\"#{ title }\"" if title
- atts = shelve( atts ) if atts
-
- "#{ pre }<a#{ atts }>#{ text }</a>#{ post }"
- end
- end
-
- MARKDOWN_REFLINK_RE = /
- \[([^\[\]]+)\] # $text
- [ ]? # opt. space
- (?:\n[ ]*)? # one optional newline followed by spaces
- \[(.*?)\] # $id
- /x
-
- def inline_markdown_reflink( text )
- text.gsub!( MARKDOWN_REFLINK_RE ) do |m|
- text, id = $~[1..2]
-
- if id.empty?
- url, title = check_refs( text )
- else
- url, title = check_refs( id )
- end
-
- atts = " href=\"#{ url }\""
- atts << " title=\"#{ title }\"" if title
- atts = shelve( atts )
-
- "<a#{ atts }>#{ text }</a>"
- end
- end
-
- MARKDOWN_LINK_RE = /
- \[([^\[\]]+)\] # $text
- \( # open paren
- [ \t]* # opt space
- <?(.+?)>? # $href
- [ \t]* # opt space
- (?: # whole title
- (['"]) # $quote
- (.*?) # $title
- \3 # matching quote
- )? # title is optional
- \)
- /x
-
- def inline_markdown_link( text )
- text.gsub!( MARKDOWN_LINK_RE ) do |m|
- text, url, quote, title = $~[1..4]
-
- atts = " href=\"#{ url }\""
- atts << " title=\"#{ title }\"" if title
- atts = shelve( atts )
-
- "<a#{ atts }>#{ text }</a>"
- end
- end
-
- TEXTILE_REFS_RE = /(^ *)\[([^\n]+?)\](#{HYPERLINK})(?=\s|$)/
- MARKDOWN_REFS_RE = /(^ *)\[([^\n]+?)\]:\s+<?(#{HYPERLINK})>?(?:\s+"((?:[^"]|\\")+)")?(?=\s|$)/m
-
- def refs( text )
- @rules.each do |rule_name|
- method( rule_name ).call( text ) if rule_name.to_s.match /^refs_/
- end
- end
-
- def refs_textile( text )
- text.gsub!( TEXTILE_REFS_RE ) do |m|
- flag, url = $~[2..3]
- @urlrefs[flag.downcase] = [url, nil]
- nil
- end
- end
-
- def refs_markdown( text )
- text.gsub!( MARKDOWN_REFS_RE ) do |m|
- flag, url = $~[2..3]
- title = $~[6]
- @urlrefs[flag.downcase] = [url, title]
- nil
- end
- end
-
- def check_refs( text )
- ret = @urlrefs[text.downcase] if text
- ret || [text, nil]
- end
-
- IMAGE_RE = /
- (<p>|.|^) # start of line?
- \! # opening
- (\<|\=|\>)? # optional alignment atts
- (#{C}) # optional style,class atts
- (?:\. )? # optional dot-space
- ([^\s(!]+?) # presume this is the src
- \s? # optional space
- (?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title
- \! # closing
- (?::#{ HYPERLINK })? # optional href
- /x
-
- def inline_textile_image( text )
- text.gsub!( IMAGE_RE ) do |m|
- stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8]
- atts = pba( atts )
- atts = " src=\"#{ url }\"#{ atts }"
- atts << " title=\"#{ title }\"" if title
- atts << " alt=\"#{ title }\""
- # size = @getimagesize($url);
- # if($size) $atts.= " $size[3]";
-
- href, alt_title = check_refs( href ) if href
- url, url_title = check_refs( url )
-
- out = ''
- out << "<a#{ shelve( " href=\"#{ href }\"" ) }>" if href
- out << "<img#{ shelve( atts ) } />"
- out << "</a>#{ href_a1 }#{ href_a2 }" if href
-
- if algn
- algn = h_align( algn )
- if stln == "<p>"
- out = "<p style=\"float:#{ algn }\">#{ out }"
- else
- out = "#{ stln }<div style=\"float:#{ algn }\">#{ out }</div>"
- end
- else
- out = stln + out
- end
-
- out
- end
- end
-
- def shelve( val )
- @shelf << val
- " <#{ @shelf.length }>"
- end
-
- def retrieve( text )
- @shelf.each_with_index do |r, i|
- text.gsub!( " <#{ i + 1 }>", r )
- end
- end
-
- def incoming_entities( text )
- ## turn any incoming ampersands into a dummy character for now.
- ## This uses a negative lookahead for alphanumerics followed by a semicolon,
- ## implying an incoming html entity, to be skipped
-
- text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" )
- end
-
- def no_textile( text )
- text.gsub!( /(^|\s)==([^=]+.*?)==(\s|$)?/,
- '\1<notextile>\2</notextile>\3' )
- text.gsub!( /^ *==([^=]+.*?)==/m,
- '\1<notextile>\2</notextile>\3' )
- end
-
- def clean_white_space( text )
- # normalize line breaks
- text.gsub!( /\r\n/, "\n" )
- text.gsub!( /\r/, "\n" )
- text.gsub!( /\t/, ' ' )
- text.gsub!( /^ +$/, '' )
- text.gsub!( /\n{3,}/, "\n\n" )
- text.gsub!( /"$/, "\" " )
-
- # if entire document is indented, flush
- # to the left side
- flush_left text
- end
-
- def flush_left( text )
- indt = 0
- if text =~ /^ /
- while text !~ /^ {#{indt}}\S/
- indt += 1
- end unless text.empty?
- if indt.nonzero?
- text.gsub!( /^ {#{indt}}/, '' )
- end
- end
- end
-
- def footnote_ref( text )
- text.gsub!( /\b\[([0-9]+?)\](\s)?/,
- '<sup><a href="#fn\1">\1</a></sup>\2' )
- end
-
- OFFTAGS = /(code|pre|kbd|notextile)/
- OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi
- OFFTAG_OPEN = /<#{ OFFTAGS }/
- OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/
- HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m
- ALLTAG_MATCH = /(<\/?\w[^\n]*?>)|.*?(?=<\/?\w[^\n]*?>|$)/m
-
- def inline_textile_glyphs( text, level = 0 )
- if text !~ HASTAG_MATCH
- pgl text
- footnote_ref text
- else
- codepre = 0
- text.gsub!( ALLTAG_MATCH ) do |line|
- ## matches are off if we're between <code>, <pre> etc.
- if $1
- if line =~ OFFTAG_OPEN
- codepre += 1
- elsif line =~ OFFTAG_CLOSE
- codepre -= 1
- codepre = 0 if codepre < 0
- end
- elsif codepre.zero?
- inline_textile_glyphs( line, level + 1 )
- else
- htmlesc( line, :NoQuotes )
- end
- ## p [level, codepre, orig_line, line]
-
- line
- end
- end
- end
-
- def rip_offtags( text )
- if text =~ /<.*>/
- ## strip and encode <pre> content
- codepre, used_offtags = 0, {}
- text.gsub!( OFFTAG_MATCH ) do |line|
- if $3
- offtag, aftertag = $4, $5
- codepre += 1
- used_offtags[offtag] = true
- if codepre - used_offtags.length > 0
- htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
- @pre_list.last << line
- line = ""
- else
- htmlesc( aftertag, :NoQuotes ) if aftertag and not used_offtags['notextile']
- line = "<redpre##{ @pre_list.length }>"
- @pre_list << "#{ $3 }#{ aftertag }"
- end
- elsif $1 and codepre > 0
- if codepre - used_offtags.length > 0
- htmlesc( line, :NoQuotes ) unless used_offtags['notextile']
- @pre_list.last << line
- line = ""
- end
- codepre -= 1 unless codepre.zero?
- used_offtags = {} if codepre.zero?
- end
- line
- end
- end
- text
- end
-
- def smooth_offtags( text )
- unless @pre_list.empty?
- ## replace <pre> content
- text.gsub!( /<redpre#(\d+)>/ ) { @pre_list[$1.to_i] }
- end
- end
-
- def inline( text )
- @rules.each do |rule_name|
- method( rule_name ).call( text ) if rule_name.to_s.match /^inline_/
- end
- end
-
- def h_align( text )
- H_ALGN_VALS[text]
- end
-
- def v_align( text )
- V_ALGN_VALS[text]
- end
-
- def textile_popup_help( name, windowW, windowH )
- ' <a target="_blank" href="http://hobix.com/textile/#' + helpvar + '" onclick="window.open(this.href, \'popupwindow\', \'width=' + windowW + ',height=' + windowH + ',scrollbars,resizable\'); return false;">' + name + '</a><br />'
- end
-
- # HTML cleansing stuff
- BASIC_TAGS = {
- 'a' => ['href', 'title'],
- 'img' => ['src', 'alt', 'title'],
- 'br' => [],
- 'i' => nil,
- 'u' => nil,
- 'b' => nil,
- 'pre' => nil,
- 'kbd' => nil,
- 'code' => ['lang'],
- 'cite' => nil,
- 'strong' => nil,
- 'em' => nil,
- 'ins' => nil,
- 'sup' => nil,
- 'sub' => nil,
- 'del' => nil,
- 'table' => nil,
- 'tr' => nil,
- 'td' => ['colspan', 'rowspan'],
- 'th' => nil,
- 'ol' => nil,
- 'ul' => nil,
- 'li' => nil,
- 'p' => nil,
- 'h1' => nil,
- 'h2' => nil,
- 'h3' => nil,
- 'h4' => nil,
- 'h5' => nil,
- 'h6' => nil,
- 'blockquote' => ['cite']
- }
-
- def clean_html( text, tags = BASIC_TAGS )
- text.gsub!( /<!\[CDATA\[/, '' )
- text.gsub!( /<(\/*)(\w+)([^>]*)>/ ) do
- raw = $~
- tag = raw[2].downcase
- if tags.has_key? tag
- pcs = [tag]
- tags[tag].each do |prop|
- ['"', "'", ''].each do |q|
- q2 = ( q != '' ? q : '\s' )
- if raw[3] =~ /#{prop}\s*=\s*#{q}([^#{q2}]+)#{q}/i
- attrv = $1
- next if prop == 'src' and attrv !~ /^http/
- pcs << "#{prop}=\"#{$1.gsub('"', '\\"')}\""
- break
- end
- end
- end if tags[tag]
- "<#{raw[1]}#{pcs.join " "}>"
- else
- " "
- end
- end
- end
-end
-
View
26 vendor/RedCloth-3.0.3/run-tests.rb
@@ -1,26 +0,0 @@
-#!/usr/bin/env ruby
-require 'lib/redcloth'
-require 'yaml'
-
-Dir["tests/*.yml"].each do |testfile|
- YAML::load_documents( File.open( testfile ) ) do |doc|
- if doc['in'] and doc['out']
- red = RedCloth.new( doc['in'] )
- html = if testfile =~ /markdown/
- red.to_html( :markdown )
- else
- red.to_html
- end
- puts "---"
-
- html.gsub!( /\n+/, "\n" )
- doc['out'].gsub!( /\n+/, "\n" )
- if html == doc['out']
- puts "success: true"
- else
- puts "out: "; p html
- puts "expected: "; p doc['out']
- end
- end
- end
-end
View
105 vendor/RedCloth-3.0.3/tests/code.yml
@@ -1,105 +0,0 @@
----
-in: 'This is an empty dictionary: @{}@'
-out: '<p>This is an empty dictionary: <code>{}</code></p>'
----
-in: |-
- Testing nested pre tags...
-
- <pre>
- <code>
- Good code here.
-
- <pre>
- a = 1
- </pre>
-
- Bad code here.
-
- <script language="JavaScript">
- window.open( "about:blank" );
- </script>
- </code>
- </pre>
-
-out: |-
- <p>Testing nested pre tags&#8230;</p>
-
-
- <pre>
- <code>
- Good code here.
-
- &lt;pre&gt;
- a = 1
- &lt;/pre&gt;
-
- Bad code here.
-
- &lt;script language="JavaScript"&gt;
- window.open( "about:blank" );
- &lt;/script&gt;
- </code>
- </pre>
----
-in: |-
- <pre>
- *** test
- </pre>
-out: |-
- <pre>
- *** test
- </pre>
----
-in: |-
- <notextile>
- *** test
- </notextile>
-out: |-
- *** test
----
-in: '*this <span></span> is strong*'
-out: '<p><strong>this <span></span> is strong</strong></p>'
----
-in: '*this <span>test</span> is strong*'
-out: '<p><strong>this <span>test</span> is strong</strong></p>'
----
-in: <pre class="code"> __inline__</pre>
-out: <pre class="code"> __inline__</pre>
----
-in: |-
- * @foo@
- * @bar@
- * and @x@ is also.
-out: "<ul>\n\t<li><code>foo</code></li>\n\t\t<li><code>bar</code></li>\n\t\t<li>and <code>x</code> is also.</li>\n\t</ul>"
----
-in: |-
- <pre class="code"> <hello> </pre>
- <pre class="code"> <hello> </pre>
-out: |-
- <pre class="code"> &lt;hello&gt; </pre>
- <pre class="code"> &lt;hello&gt; </pre>
----
-in: |
- Test of Markdown-style indented code.
-
- a = [1, 2, 3]
- a.each do |x|
- puts "test number", x,
- "and more!"
- end
-
- Paragraph 2.
-
- Paragraph 3.
-out: |-
- <p>Test of Markdown-style indented code.</p>
-
- <pre><code>a = [1, 2, 3]
- a.each do |x|
- puts "test number", x,
- "and more!"
- end</code></pre>
-
- <p>Paragraph 2.</p>
-
- <p>Paragraph 3.</p>
View
171 vendor/RedCloth-3.0.3/tests/images.yml
@@ -1,171 +0,0 @@
----
-in: This is an !image.jpg!
-out: <p>This is an <img src="image.jpg" alt="" /></p>
----
-in: This is an !image.jpg(with alt text)!
-out: <p>This is an <img src="image.jpg" title="with alt text" alt="with alt text" /></p>
----
-in: This is an !http://example.com/i/image.jpg!
-out: <p>This is an <img src="http://example.com/i/image.jpg" alt="" /></p>
----
-in: This is an !http://example.com/i/image.jpg#a1!
-out: <p>This is an <img src="http://example.com/i/image.jpg#a1" alt="" /></p>
----
-in: This is an !image.jpg!.
-out: <p>This is an <img src="image.jpg" alt="" />.</p>
----
-in: This is an !image.jpg(with alt text)!.
-out: <p>This is an <img src="image.jpg" title="with alt text" alt="with alt text" />.</p>
----
-in: This is an !http://example.com/i/image.jpg!.
-out: <p>This is an <img src="http://example.com/i/image.jpg" alt="" />.</p>
----
-in: This is an !http://example.com/i/image.jpg#a1!.
-out: <p>This is an <img src="http://example.com/i/image.jpg#a1" alt="" />.</p>
----
-in: This is not an image!!!
-out: <p>This is not an image!!!</p>
----
-in: This is an !http://example.com/i/image.jpg!:#1
-out: <p>This is an <a href="#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:#a
-out: <p>This is an <a href="#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:#a1
-out: <p>This is an <a href="#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:#a10
-out: <p>This is an <a href="#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html
-out: <p>This is an <a href="index.html"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html#1
-out: <p>This is an <a href="index.html#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html#a1
-out: <p>This is an <a href="index.html#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html#a10
-out: <p>This is an <a href="index.html#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar
-out: <p>This is an <a href="index.html?foo=bar"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#1
-out: <p>This is an <a href="index.html?foo=bar#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a
-out: <p>This is an <a href="index.html?foo=bar#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a1
-out: <p>This is an <a href="index.html?foo=bar#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:index.html?foo=bar#a10
-out: <p>This is an <a href="index.html?foo=bar#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/
-out: <p>This is an <a href="http://example.com/"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/#1
-out: <p>This is an <a href="http://example.com/#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/#a
-out: <p>This is an <a href="http://example.com/#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/#a1
-out: <p>This is an <a href="http://example.com/#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/#a10
-out: <p>This is an <a href="http://example.com/#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html
-out: <p>This is an <a href="http://example.com/index.html"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#1
-out: <p>This is an <a href="http://example.com/index.html#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a
-out: <p>This is an <a href="http://example.com/index.html#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a1
-out: <p>This is an <a href="http://example.com/index.html#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html#a10
-out: <p>This is an <a href="http://example.com/index.html#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar
-out: <p>This is an <a href="http://example.com/index.html?foo=bar"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#1
-out: <p>This is an <a href="http://example.com/index.html?foo=bar#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a
-out: <p>This is an <a href="http://example.com/index.html?foo=bar#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a1
-out: <p>This is an <a href="http://example.com/index.html?foo=bar#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar#a10
-out: <p>This is an <a href="http://example.com/index.html?foo=bar#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a1"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a></p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#1"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a1"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a>.</p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b, but this is not.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b"><img src="http://example.com/i/image.jpg" alt="" /></a>, but this is not.</p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1, but this is not.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#1"><img src="http://example.com/i/image.jpg" alt="" /></a>, but this is not.</p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a, but this is not.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a"><img src="http://example.com/i/image.jpg" alt="" /></a>, but this is not.</p>
----
-in: This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1, but this is not.
-out: <p>This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a1"><img src="http://example.com/i/image.jpg" alt="" /></a>, but this is not.</p>
----
-in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10) This is not.
-out: <p>(This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
----
-in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b) This is not.
-out: <p>(This is an <a href="http://example.com/index.html?foo=bar&#38;a=b"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
----
-in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#1) This is not.
-out: <p>(This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#1"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
----
-in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a) This is not.
-out: <p>(This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
----
-in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a1) This is not.
-out: <p>(This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a1"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
----
-in: (This is an !http://example.com/i/image.jpg!:http://example.com/index.html?foo=bar&a=b#a10) This is not.
-out: <p>(This is an <a href="http://example.com/index.html?foo=bar&#38;a=b#a10"><img src="http://example.com/i/image.jpg" alt="" /></a>) This is not.</p>
View
39 vendor/RedCloth-3.0.3/tests/instiki.yml
@@ -1,39 +0,0 @@
---- # Bugs filed at http://www.instiki.org/show/BugReports
-in: |-
- _Hi, <span class="newWikiWord">Joe Bob<a href="../show/JoeBob">?</a></span>, this should all be in italic!_
-out: |-
- <p><em>Hi, <span class="newWikiWord">Joe Bob<a href="../show/JoeBob">?</a></span>, this should all be in italic!</em></p>
----
-in: '*this <span>span</span> is strong*'
-out: '<p><strong>this <span>span</span> is strong</strong></p>'
----
-in: '*this <span>Camel Thing<a href="../show/CamelThing">?</a></span> is strong*'
-out: '<p><strong>this <span>Camel Thing<a href="../show/CamelThing">?</a></span> is strong</strong></p>'
----
-in: '_this <span>span</span> is italic_'
-out: '<p><em>this <span>span</span> is italic</em></p>'
----
-in: '%{color:red}nested span because of <span><span class="newWikiWord">Camel Word<a href="../show/CamelWord">?</a></span></span>%'
-out: '<p><span style="color:red;">nested span because of <span><span class="newWikiWord">Camel Word<a href="../show/CamelWord">?</a></span></span></span></p>'
----
-in: |-
- h2. Version History
-
- * "Version
- 0.0":http://www.threewordslong.com/render-0-8-9b.patch - Early version using MD5 hashes.
- * "Version
- 0.1":http://www.threewordslong.com/chunk-0-1.patch.gz - First cut of new system. Much cleaner.
- * "Version 0.2":http://www.threewordslong.com/chunk-0-2.patch.gz - Fixed problem with "authors" page and some tests.
-out: |-
- <h2>Version History</h2>
-
- <ul>
- <li><a href="http://www.threewordslong.com/render-0-8-9b.patch">Version
- 0.0</a> &#8211; Early version using <span class="caps">MD5</span> hashes.</li>
- <li><a href="http://www.threewordslong.com/chunk-0-1.patch.gz">Version
- 0.1</a> &#8211; First cut of new system. Much cleaner.</li>
- <li><a href="http://www.threewordslong.com/chunk-0-2.patch.gz">Version 0.2</a> &#8211; Fixed problem with &#8220;authors&#8221; page and some tests.</li>
- </ul>
----
-in: "--richSeymour --whyTheLuckyStiff"
-out: "<p>&#8212;richSeymour&#8212;whyTheLuckyStiff</p>"
View
155 vendor/RedCloth-3.0.3/tests/links.yml
@@ -1,155 +0,0 @@
----
-in: '"link text":#1'
-out: <p><a href="#1">link text</a></p>
----
-in: '"link text":#a'
-out: <p><a href="#a">link text</a></p>
----
-in: '"link text":#a1'
-out: <p><a href="#a1">link text</a></p>
----
-in: '"link text":#a10'
-out: <p><a href="#a10">link text</a></p>
----
-in: '"link text":index.html'
-out: <p><a href="index.html">link text</a></p>
----
-in: '"link text":index.html#1'
-out: <p><a href="index.html#1">link text</a></p>
----
-in: '"link text":index.html#a'
-out: <p><a href="index.html#a">link text</a></p>
----
-in: '"link text":index.html#a1'
-out: <p><a href="index.html#a1">link text</a></p>
----
-in: '"link text":index.html#a10'
-out: <p><a href="index.html#a10">link text</a></p>
----
-in: '"link text":http://example.com/'
-out: <p><a href="http://example.com/">link text</a></p>
----
-in: '"link text":http://example.com/#1'
-out: <p><a href="http://example.com/#1">link text</a></p>
----
-in: '"link text":http://example.com/#a'
-out: <p><a href="http://example.com/#a">link text</a></p>
----
-in: '"link text":http://example.com/#a1'
-out: <p><a href="http://example.com/#a1">link text</a></p>
----
-in: '"link text":http://example.com/#a10'
-out: <p><a href="http://example.com/#a10">link text</a></p>
----
-in: '"link text":http://example.com/index.html'
-out: <p><a href="http://example.com/index.html">link text</a></p>
----
-in: '"link text":http://example.com/index.html#a'
-out: <p><a href="http://example.com/index.html#a">link text</a></p>
----
-in: '"link text":http://example.com/index.html#1'
-out: <p><a href="http://example.com/index.html#1">link text</a></p>
----
-in: '"link text":http://example.com/index.html#a1'
-out: <p><a href="http://example.com/index.html#a1">link text</a></p>
----
-in: '"link text":http://example.com/index.html#a10'
-out: <p><a href="http://example.com/index.html#a10">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar'
-out: <p><a href="http://example.com/?foo=bar">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar#a'
-out: <p><a href="http://example.com/?foo=bar#a">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar#1'
-out: <p><a href="http://example.com/?foo=bar#1">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar#a1'
-out: <p><a href="http://example.com/?foo=bar#a1">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar#a10'
-out: <p><a href="http://example.com/?foo=bar#a10">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar&a=b'
-out: <p><a href="http://example.com/?foo=bar&#38;a=b">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar&a=b#1'
-out: <p><a href="http://example.com/?foo=bar&#38;a=b#1">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar&a=b#a'
-out: <p><a href="http://example.com/?foo=bar&#38;a=b#a">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar&a=b#a1'
-out: <p><a href="http://example.com/?foo=bar&#38;a=b#a1">link text</a></p>
----
-in: '"link text":http://example.com/?foo=bar&a=b#a10'
-out: <p><a href="http://example.com/?foo=bar&#38;a=b#a10">link text</a></p>
----
-in: 'This is a "link":http://example.com/'
-out: <p>This is a <a href="http://example.com/">link</a></p>
----
-in: 'This is a "link":http://example.com/.'
-out: <p>This is a <a href="http://example.com/">link</a>.</p>
----
-in: 'This is a "link":http://example.com/index.html.'
-out: <p>This is a <a href="http://example.com/index.html">link</a>.</p>
----
-in: 'This is a "link":http://example.com/index.html#a.'
-out: <p>This is a <a href="http://example.com/index.html#a">link</a>.</p>
----
-in: 'This is a "link":http://example.com/index.html#1.'
-out: <p>This is a <a href="http://example.com/index.html#1">link</a>.</p>
----
-in: 'This is a "link":http://example.com/index.html#a1.'
-out: <p>This is a <a href="http://example.com/index.html#a1">link</a>.</p>
----
-in: 'This is a "link":http://example.com/index.html#a10.'
-out: <p>This is a <a href="http://example.com/index.html#a10">link</a>.</p>
----
-in: 'This is a "link":http://example.com/?foo=bar.'
-out: <p>This is a <a href="http://example.com/?foo=bar">link</a>.</p>
----
-in: 'This is a "link":http://example.com/?foo=bar#1.'
-out: <p>This is a <a href="http://example.com/?foo=bar#1">link</a>.</p>
----
-in: 'This is a "link":http://example.com/?foo=bar#a.'
-out: <p>This is a <a href="http://example.com/?foo=bar#a">link</a>.</p>
----
-in: 'This is a "link":http://example.com/?foo=bar#a1.'
-out: <p>This is a <a href="http://example.com/?foo=bar#a1">link</a>.</p>
----
-in: 'This is a "link":http://example.com/?foo=bar#a10.'
-out: <p>This is a <a href="http://example.com/?foo=bar#a10">link</a>.</p>
----
-in: 'This is a "link":http://example.com/?foo=bar#a10, but this is not.'
-out: <p>This is a <a href="http://example.com/?foo=bar#a10">link</a>, but this is not.</p>
----
-in: '(This is a "link":http://example.com/?foo=bar#a10) but this is not.'
-out: <p>(This is a <a href="http://example.com/?foo=bar#a10">link</a>) but this is not.</p>
----
-in: '"link text(link title)":http://example.com/'
-out: <p><a href="http://example.com/" title="link title">link text</a></p>
-# ---
-# in: '"link text(link title) ":http://example.com/'
-# out: <p>&#8220;link text(link title) &#8220;:http://example.com/</p>
-# comments: this is a real test and should pass
----
-in: '"(link) text(link title)":http://example.com/'
-out: <p><a href="http://example.com/" class="link" title="link title"> text</a></p>
-comments: link text can not contain parentheses
----
-in: '"Dive Into XML":http://www.xml.com/pub/au/164'
-out: <p><a href="http://www.xml.com/pub/au/164">Dive Into <span class="caps">XML</span></a></p>
----
-in: '"Lab Exercises":../lab/exercises/exercises.html.'
-out: <p><a href="../lab/exercises/exercises.html">Lab Exercises</a>.</p>
----
-in: 'Go to "discuss":http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1&thread=26627 to discuss.'
-out: <p>Go to <a href="http://www.dreammoods.com/cgibin/cutecast/cutecast.pl?forum=1&#38;thread=26627">discuss</a> to discuss.</p>
----
-in: '* "rubylang":http://www.ruby-lang.org/en/'
-out: "<ul>\n\t<li><a href=\"http://www.ruby-lang.org/en/\">rubylang</a></li>\n\t</ul>"
----
-in: 'The ION coding style document found at "IONCodingStyleGuide.doc":http://perforce:8081/@md=d&cd=//&c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22 codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in ION. Test text'
-out: <p>The <span class="caps">ION</span> coding style document found at <a href="http://perforce:8081/@md=d&#38;cd=//&#38;c=82E@//depot/systest/system/main/pub/doc/IONCodingStyleGuide.doc?ac=22">IONCodingStyleGuide.doc</a> codifies a couple of rules to ensure reasonably consistent code and documentation of libraries in <span class="caps">ION</span>. Test text</p>
View
77 vendor/RedCloth-3.0.3/tests/lists.yml
@@ -1,77 +0,0 @@
---- # Bret Pettichord, Thanks.
-in: |-
- * first line
- * second
- line
- * third line
-out: |-
- <ul>
- <li>first line</li>
- <li>second
- line</li>
- <li>third line</li>
- </ul>
----
-in: |-
- p. start
-
- * one
- and one
- * two
- and two
- * three
-
- p. end
-out: |-
- <p>start</p>
- <ul>
- <li>one
- and one</li>
- <li>two
- and two</li>
- <li>three</li>
- </ul>
-
- <p>end</p>
----
-in: |-
- Funky:
-
- * Testing
- *# number
- *##* bullet
- *# number
- *# number
- yeah number
- #* bullet
- *** okay
- ****# what
-
-
-out: |-
- <p>Funky:</p>
- <ul>
- <li>Testing
- <ol>
- <li>number
- <ul>
- <li>bullet</li>
- </ul>
- </li>
- <li>number</li>
- <li>number
- yeah number</li>
- <ul>
- <li>bullet
- <ul>
- <li>okay
- <ol>
- <li>what</li>
- </ul></li>
- </ol></li>
- </ul></li>
- </ul></li>
- </ol>
----
-in: "* command run: @time ruby run-tests.rb > toto@"
-out: "<ul>\n\t<li>command run: <code>time ruby run-tests.rb &gt; toto</code></li>\n\t</ul>"
View
218 vendor/RedCloth-3.0.3/tests/markdown.yml
@@ -1,218 +0,0 @@
-in: |
- This is a regular paragraph.
-
- <table>
- <tr>
- <td>Foo</td>
- </tr>
- </table>
-
- This is another regular paragraph.
-out: |-
- <p>This is a regular paragraph.</p>
-
-
- <table>
- <tr>
- <td>Foo</td>
- </tr>
- </table>
- <p>This is another regular paragraph.</p>
----
-in: '"Larry Bird":http://images.google.com/images?num=30&q=larry+bird'
-out: '<p>"Larry Bird":http://images.google.com/images?num=30&#38;q=larry+bird</p>'
----
-in: '&copy;'
-out: <p>&copy;</p>
----
-in: AT&T
-out: <p>AT&#38;T</p>
-
-# We don't do this.
-# ---
-# in: 4 < 5
-# out: 4 &lt; 5
----
-in: |
- This is an H1
- =============
-
- This is an H2
- -------------
-out: |-
- <h1>This is an H1</h1>
-
- <h2>This is an H2</h2>
----
-in: |
- # This is an H1
-
- ## This is an H2
-
- ###### This is an H6
-out: |-
- <h1>This is an H1</h1>
-
- <h2>This is an H2</h2>
-
- <h6>This is an H6</h6>
----
-in: |
- > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
- > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
- > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
- >
- > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
- > id sem consectetuer libero luctus adipiscing.
-out: |-
- <blockquote>
- <p>This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
- consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
- Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</p>
-
- <p>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
- id sem consectetuer libero luctus adipiscing.</p>
-
- </blockquote>
----
-in: |
- > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
- consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
- Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
- >
- > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
- id sem consectetuer libero luctus adipiscing.
-out: |-
- <blockquote>
- <p>This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
- consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
- Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</p>
-
- <p>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
- id sem consectetuer libero luctus adipiscing.</p>
-
- </blockquote>
----
-in: |
- > This is the first level of quoting.
- >
- > > This is nested blockquote.
- >
- > Back to the first level.
-out: |-
- <blockquote>
- <p>This is the first level of quoting.</p>
- <blockquote>
- <p>This is nested blockquote.</p>
-
- </blockquote>
-
-
-
- <p>Back to the first level.</p>
-
- </blockquote>
----
-in: |
- > ## This is a header.
- >
- > 1. This is the first list item.
- > 2. This is the second list item.
- >
- > Here's some example code:
- >
- > return shell_exec("echo $input | $markdown_script");
-out: |-
- <blockquote>
- <h2>This is a header.</h2>
-
-
-
- <p>1. This is the first list item.
- 2. This is the second list item.</p>
-
- <p>Here's some example code:</p>
- <pre><code>return shell_exec("echo $input | $markdown_script");</code></pre>
-
- </blockquote>
----
-in: |
- * * *
-
- ***
-
- *****
-
- - - -
-
- ---------------------------------------
-
- _ _ _
-out: |-
- <hr />
-
- <hr />
-
- <hr />
-
- <hr />
-
- <hr />
-
- <hr />
----
-in: |
- This is [an example](http://example.com/ "Title") inline link.
-
- [This link](http://example.net/) has no title attribute.
-out: |-
- <p>This is <a href="http://example.com/" title="Title">an example</a> inline link.</p>
-
- <p><a href="http://example.net/">This link</a> has no title attribute.</p>
----
-in: See my [About](/about/) page for details.
-out: <p>See my <a href="/about/">About</a> page for details.</p>
----
-in: |
- This is [an example][id] reference-style link.
-
- This is [an example] [id] reference-style link.
-
- [id]: http://example.com/ "Optional Title Here"
-out: |-
- <p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.</p>
-
- <p>This is <a href="http://example.com/" title="Optional Title Here">an example</a> reference-style link.</p>
----
-in: |
- [Google][]
- [Google]: http://google.com/
-out: <p><a href="http://google.com/">Google</a></p>
----
-in: |
- Visit [Daring Fireball][] for more information.
- [Daring Fireball]: http://daringfireball.net/
-out: <p>Visit <a href="http://daringfireball.net/">Daring Fireball</a> for more information.</p>
----
-in: |
- I get 10 times more traffic from [Google] [1] than from
- [Yahoo] [2] or [MSN] [3].
-
- [1]: http://google.com/ "Google"
- [2]: http://search.yahoo.com/ "Yahoo Search"
- [3]: http://search.msn.com/ "MSN Search"
-
-out: |-
- <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from
- <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
----
-in: |
- I get 10 times more traffic from [Google][] than from
- [Yahoo][] or [MSN][].
-
- [google]: http://google.com/ "Google"
- [yahoo]: http://search.yahoo.com/ "Yahoo Search"
- [msn]: http://search.msn.com/ "MSN Search"
-out: |-
- <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from
- <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
View
64 vendor/RedCloth-3.0.3/tests/poignant.yml
@@ -1,64 +0,0 @@
---- # Tests from the (Poignant Guide)
-in: >
- h3. False
-
-
- !<i/blix-neg.gif(Shape of a cat.)!
-
-
- _The cat Trady Blix. Frozen in emptiness. Immaculate whiskers rigid. Placid
- eyes of lake. Tail of warm icicle. Sponsored by a Very Powerful Pause Button._
-
-
- The darkness surrounding Blix can be called *negative space*. Hang on to that phrase.
- Let it suggest that the emptiness has a negative connotation. In a similar way,
- @nil@ has a slightly sour note that it whistles.
-
-
- Generally speaking, everything in Ruby has a positive charge to it. This spark
- flows through strings, numbers, regexps, all of it. Only two keywords wear a
- shady cloak: @nil@ and @false@ draggin us down.
-
-
- You can test that charge with an @if@ keyword. It looks very much like the
- @do@ blocks we saw in the last chapter, in that both end with an @end@.
-
-
- <pre>
- if plastic_cup
- print "Plastic cup is on the up 'n' up!"
- end
- </pre>
-
-
- If @plastic_cup@ contains either @nil@ or @false@, you won't see anything print
- to the screen. They're not on the @if@ guest list. So @if@ isn't going to run
- any of the code it's protecting.
-
-
- But @nil@ and @false@ need not walk away in shame. They may be of questionable
- character, but @unless@ runs a smaller establishment that caters to the bedraggled.
- The @unless@ keyword has a policy of only allowing those with a negative charge in.
- Who are: @nil@ and @false@.
-
-
- <pre>
- unless plastic_cup
- print "Plastic cup is on the down low."
- end
- </pre>
-
-
- You can also use @if@ and @unless@ at the end of a single line of code, if that's
- all that is being protected.
-
-
- <pre>
- print "Yeah, plastic cup is up again!" if plastic_cup
- print "Hardly. It's down." unless plastic_cup
- </pre>
-
-
- Now that you've met @false@, I'm sure you can see what's on next.
-
-out: "<h3>False</h3>\n\n\t<p style=\"float:left\"><img src=\"i/blix-neg.gif\" title=\"Shape of a cat.\" alt=\"Shape of a cat.\" /></p>\n\n\t<p><em>The cat Trady Blix. Frozen in emptiness. Immaculate whiskers rigid. Placid eyes of lake. Tail of warm icicle. Sponsored by a Very Powerful Pause Button.</em></p>\n\n\t<p>The darkness surrounding Blix can be called <strong>negative space</strong>. Hang on to that phrase. Let it suggest that the emptiness has a negative connotation. In a similar way, <code>nil</code> has a slightly sour note that it whistles.</p>\n\n\t<p>Generally speaking, everything in Ruby has a positive charge to it. This spark flows through strings, numbers, regexps, all of it. Only two keywords wear a shady cloak: <code>nil</code> and <code>false</code> draggin us down.</p>\n\n\t<p>You can test that charge with an <code>if</code> keyword. It looks very much like the <code>do</code> blocks we saw in the last chapter, in that both end with an <code>end</code>.</p>\n\n\n<pre>\n if plastic_cup\n print \"Plastic cup is on the up 'n' up!\" \n end\n</pre>\n\t<p>If <code>plastic_cup</code> contains either <code>nil</code> or <code>false</code>, you won&#8217;t see anything print to the screen. They&#8217;re not on the <code>if</code> guest list. So <code>if</code> isn&#8217;t going to run any of the code it&#8217;s protecting.</p>\n\n\t<p>But <code>nil</code> and <code>false</code> need not walk away in shame. They may be of questionable character, but <code>unless</code> runs a smaller establishment that caters to the bedraggled. The <code>unless</code> keyword has a policy of only allowing those with a negative charge in. Who are: <code>nil</code> and <code>false</code>.</p>\n\n\n<pre>\n unless plastic_cup\n print \"Plastic cup is on the down low.\" \n end\n</pre>\n\t<p>You can also use <code>if</code> and <code>unless</code> at the end of a single line of code, if that&#8217;s all that is being protected.</p>\n\n\n<pre>\n print \"Yeah, plastic cup is up again!\" if plastic_cup\n print \"Hardly. It's down.\" unless plastic_cup\n</pre>\n\t<p>Now that you&#8217;ve met <code>false</code>, I&#8217;m sure you can see what&#8217;s on next.</p>"
View
198 vendor/RedCloth-3.0.3/tests/table.yml
@@ -1,198 +0,0 @@
-in: |
- {background:#ddd}. |S|Target|Complete|App|Milestone|
- |!/i/g.gif!|11/18/04|11/18/04|070|XML spec complete|
- |!/i/g.gif!|11/29/04|11/29/04|011|XML spec complete (KH is on schedule)|
- |!/i/g.gif!|11/29/04|11/29/04|051|XML spec complete (KH is on schedule)|
- |!/i/g.gif!|11/29/04|11/29/04|081|XML spec complete (KH is on schedule)|
- |!/i/g.gif!|11/19/04|11/22/04|070|Preprocessor complete|
- |!/i/g.gif!|11/22/04|11/22/04|070|Dialog pass 1 builds an index file|
- |!/i/g.gif!|11/24/04|11/24/04|070|Dialog pass 2 98% complete|
- |!/i/g.gif!|11/30/04|11/30/04|070|Feature complete. Passes end-to-end smoke test.|
- |!/i/g.gif!|11/30/04|11/30/04|011|Preprocessor updates complete|
- |!/i/g.gif!|11/30/04|11/30/04|051|Preprocessor updates complete|
- |!/i/g.gif!|11/30/04|11/29/04|081|Preprocessor updates complete|
- |!/i/w.gif!|12/02/04|.|011|Dialog pass 1 and 2 complete (98+%)|
- |!/i/w.gif!|12/02/04|.|051|Dialog pass 1 and 2 complete (98+%)|
- |!/i/w.gif!|12/02/04|.|081|Dialog pass 1 and 2 complete (98+%)|
- |!/i/w.gif!|12/03/04|.|011|Feature complete|
- |!/i/w.gif!|12/03/04|.|051|Feature complete|
- |!/i/w.gif!|12/03/04|.|081|Feature complete|
- |!/i/w.gif!|12/10/04|.|011|Deployed to Napa test workstation. Passes smoke test.|
- |!/i/w.gif!|12/10/04|.|051|Deployed to Napa test workstation. Passes smoke test.|
- |!/i/w.gif!|12/10/04|.|081|Deployed to Napa test workstation. Passes smoke test.|
- |!/i/w.gif!|12/10/04|.|070|Deployed to Napa test workstation. Passes smoke test.|
- |!/i/w.gif!|12/17/04|.|011|System testing complete. Begin testing with live customer data.|
- |!/i/w.gif!|12/17/04|.|051|System testing complete. Begin testing with live customer data.|
- |!/i/w.gif!|12/17/04|.|081|System testing complete. Begin testing with live customer data.|
- |!/i/w.gif!|12/17/04|.|070|System testing complete. Begin testing with live customer data.|
-out: |-
- <table>
- <tr style="background:#ddd;">
- <td>S</td>
- <td>Target</td>
- <td>Complete</td>
- <td>App</td>
- <td>Milestone</td>
- </tr>
- <tr>
- <td><img src="/i/g.gif" alt="" /></td>
- <td>11/18/04</td>
- <td>11/18/04</td>
- <td>070</td>
- <td>XML spec complete</td>
- </tr>
- <tr>
- <td><img src="/i/g.gif" alt="" /></td>
- <td>11/29/04</td>
- <td>11/29/04</td>
- <td>011</td>
- <td>XML spec complete (KH is on schedule)</td>
- </tr>
- <tr>
- <td><img src="/i/g.gif" alt="" /></td>
- <td>11/29/04</td>
- <td>11/29/04</td>
- <td>051</td>
- <td>XML spec complete (KH is on schedule)</td>