* lib/rdoc.rb: Updated VERSION.
* lib/rdoc/markup/attribute_manager.rb: Removed useless empty check. * lib/rdoc/markup/to_markdown.rb: Support links from other formats. * lib/rdoc/markup/formatter.rb: ditto. * lib/rdoc/markup/to_html.rb: ditto. * test/rdoc/test_rdoc_markup_formatter.rb: Test for above. * test/rdoc/test_rdoc_markup_to_html.rb: ditto. * test/rdoc/test_rdoc_markup_to_markdown.rb: ditto. * lib/rdoc/rd/block_parser.rb: Improved footnote display. Worked around bug in footnote conversion to Markdown. * test/rdoc/test_rdoc_rd_block_parser.rb: Test for above. * lib/rdoc/rd/inline_parser.rb: Fixed bug with emphasis inside verbatim. * test/rdoc/test_rdoc_rd_inline_parser.rb: Test for above. * test/rdoc/test_rdoc_parser_rd.rb: Use mu_pp, use shortcut methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
10295ab2ff
commit
810008293f
@ -64,7 +64,7 @@ module RDoc
|
|||||||
##
|
##
|
||||||
# RDoc version you are using
|
# RDoc version you are using
|
||||||
|
|
||||||
VERSION = '4.0.0.preview2'
|
VERSION = '4.0.0.preview2.1'
|
||||||
|
|
||||||
##
|
##
|
||||||
# Method visibilities
|
# Method visibilities
|
||||||
|
@ -168,7 +168,6 @@ class RDoc::Markup::AttributeManager
|
|||||||
# Converts special sequences to RDoc attributes
|
# Converts special sequences to RDoc attributes
|
||||||
|
|
||||||
def convert_specials str, attrs
|
def convert_specials str, attrs
|
||||||
unless @special.empty?
|
|
||||||
@special.each do |regexp, attribute|
|
@special.each do |regexp, attribute|
|
||||||
str.scan(regexp) do
|
str.scan(regexp) do
|
||||||
capture = $~.size == 1 ? 0 : 1
|
capture = $~.size == 1 ? 0 : 1
|
||||||
@ -179,7 +178,6 @@ class RDoc::Markup::AttributeManager
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Escapes special sequences of text to prevent conversion to RDoc
|
# Escapes special sequences of text to prevent conversion to RDoc
|
||||||
|
@ -17,6 +17,30 @@ class RDoc::Markup::Formatter
|
|||||||
|
|
||||||
InlineTag = Struct.new(:bit, :on, :off)
|
InlineTag = Struct.new(:bit, :on, :off)
|
||||||
|
|
||||||
|
##
|
||||||
|
# Converts a target url to one that is relative to a given path
|
||||||
|
|
||||||
|
def self.gen_relative_url path, target
|
||||||
|
from = File.dirname path
|
||||||
|
to, to_file = File.split target
|
||||||
|
|
||||||
|
from = from.split "/"
|
||||||
|
to = to.split "/"
|
||||||
|
|
||||||
|
from.delete '.'
|
||||||
|
to.delete '.'
|
||||||
|
|
||||||
|
while from.size > 0 and to.size > 0 and from[0] == to[0] do
|
||||||
|
from.shift
|
||||||
|
to.shift
|
||||||
|
end
|
||||||
|
|
||||||
|
from.fill ".."
|
||||||
|
from.concat to
|
||||||
|
from << to_file
|
||||||
|
File.join(*from)
|
||||||
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# Creates a new Formatter
|
# Creates a new Formatter
|
||||||
|
|
||||||
@ -35,6 +59,7 @@ class RDoc::Markup::Formatter
|
|||||||
@tt_bit = @attributes.bitmap_for :TT
|
@tt_bit = @attributes.bitmap_for :TT
|
||||||
|
|
||||||
@hard_break = ''
|
@hard_break = ''
|
||||||
|
@from_path = '.'
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -51,6 +76,26 @@ class RDoc::Markup::Formatter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Adds a special for links of the form rdoc-...:
|
||||||
|
|
||||||
|
def add_special_RDOCLINK
|
||||||
|
@markup.add_special(/rdoc-[a-z]+:\S+/, :RDOCLINK)
|
||||||
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Adds a special for links of the form {<text>}[<url>] and <word>[<url>]
|
||||||
|
|
||||||
|
def add_special_TIDYLINK
|
||||||
|
@markup.add_special(/(?:
|
||||||
|
\{.*?\} | # multi-word label
|
||||||
|
\b[^\s{}]+? # single-word label
|
||||||
|
)
|
||||||
|
|
||||||
|
\[\S+?\] # link target
|
||||||
|
/x, :TIDYLINK)
|
||||||
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# Add a new set of tags for an attribute. We allow separate start and end
|
# Add a new set of tags for an attribute. We allow separate start and end
|
||||||
# tags for flexibility
|
# tags for flexibility
|
||||||
@ -178,6 +223,36 @@ class RDoc::Markup::Formatter
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Extracts and a scheme, url and an anchor id from +url+ and returns them.
|
||||||
|
|
||||||
|
def parse_url url
|
||||||
|
case url
|
||||||
|
when /^rdoc-label:([^:]*)(?::(.*))?/ then
|
||||||
|
scheme = 'link'
|
||||||
|
path = "##{$1}"
|
||||||
|
id = " id=\"#{$2}\"" if $2
|
||||||
|
when /([A-Za-z]+):(.*)/ then
|
||||||
|
scheme = $1.downcase
|
||||||
|
path = $2
|
||||||
|
when /^#/ then
|
||||||
|
else
|
||||||
|
scheme = 'http'
|
||||||
|
path = url
|
||||||
|
url = "http://#{url}"
|
||||||
|
end
|
||||||
|
|
||||||
|
if scheme == 'link' then
|
||||||
|
url = if path[0, 1] == '#' then # is this meaningful?
|
||||||
|
path
|
||||||
|
else
|
||||||
|
self.class.gen_relative_url @from_path, path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
[scheme, url, id]
|
||||||
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# Is +tag+ a tt tag?
|
# Is +tag+ a tt tag?
|
||||||
|
|
||||||
|
@ -36,30 +36,6 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||||||
|
|
||||||
attr_accessor :from_path
|
attr_accessor :from_path
|
||||||
|
|
||||||
##
|
|
||||||
# Converts a target url to one that is relative to a given path
|
|
||||||
|
|
||||||
def self.gen_relative_url(path, target)
|
|
||||||
from = File.dirname path
|
|
||||||
to, to_file = File.split target
|
|
||||||
|
|
||||||
from = from.split "/"
|
|
||||||
to = to.split "/"
|
|
||||||
|
|
||||||
from.delete '.'
|
|
||||||
to.delete '.'
|
|
||||||
|
|
||||||
while from.size > 0 and to.size > 0 and from[0] == to[0] do
|
|
||||||
from.shift
|
|
||||||
to.shift
|
|
||||||
end
|
|
||||||
|
|
||||||
from.fill ".."
|
|
||||||
from.concat to
|
|
||||||
from << to_file
|
|
||||||
File.join(*from)
|
|
||||||
end
|
|
||||||
|
|
||||||
# :section:
|
# :section:
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -79,17 +55,8 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||||||
@markup.add_special(/(?:link:|https?:|mailto:|ftp:|irc:|www\.)\S+\w/,
|
@markup.add_special(/(?:link:|https?:|mailto:|ftp:|irc:|www\.)\S+\w/,
|
||||||
:HYPERLINK)
|
:HYPERLINK)
|
||||||
|
|
||||||
# internal links
|
add_special_RDOCLINK
|
||||||
@markup.add_special(/rdoc-[a-z]+:\S+/, :RDOCLINK)
|
add_special_TIDYLINK
|
||||||
|
|
||||||
# and links of the form <text>[<url>]
|
|
||||||
@markup.add_special(/(?:
|
|
||||||
\{.*?\} | # multi-word label
|
|
||||||
\b[^\s{}]+? # single-word label
|
|
||||||
)
|
|
||||||
|
|
||||||
\[\S+?\] # link target
|
|
||||||
/x, :TIDYLINK)
|
|
||||||
|
|
||||||
init_tags
|
init_tags
|
||||||
end
|
end
|
||||||
@ -325,32 +292,13 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
|
|||||||
# for img: and link: described under handle_special_HYPERLINK
|
# for img: and link: described under handle_special_HYPERLINK
|
||||||
|
|
||||||
def gen_url url, text
|
def gen_url url, text
|
||||||
if url =~ /^rdoc-label:([^:]*)(?::(.*))?/ then
|
scheme, url, id = parse_url url
|
||||||
type = "link"
|
|
||||||
path = "##{$1}"
|
|
||||||
id = " id=\"#{$2}\"" if $2
|
|
||||||
elsif url =~ /([A-Za-z]+):(.*)/ then
|
|
||||||
type = $1
|
|
||||||
path = $2
|
|
||||||
else
|
|
||||||
type = "http"
|
|
||||||
path = url
|
|
||||||
url = "http://#{url}"
|
|
||||||
end
|
|
||||||
|
|
||||||
if type == "link" then
|
if %w[http https link].include?(scheme) and
|
||||||
url = if path[0, 1] == '#' then # is this meaningful?
|
|
||||||
path
|
|
||||||
else
|
|
||||||
self.class.gen_relative_url @from_path, path
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if (type == "http" or type == "https" or type == "link") and
|
|
||||||
url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then
|
url =~ /\.(gif|png|jpg|jpeg|bmp)$/ then
|
||||||
"<img src=\"#{url}\" />"
|
"<img src=\"#{url}\" />"
|
||||||
else
|
else
|
||||||
"<a#{id} href=\"#{url}\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
|
"<a#{id} href=\"#{url}\">#{text.sub(%r{^#{scheme}:/*}i, '')}</a>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@ class RDoc::Markup::ToMarkdown < RDoc::Markup::ToRdoc
|
|||||||
@headings[5] = ['##### ', '']
|
@headings[5] = ['##### ', '']
|
||||||
@headings[6] = ['###### ', '']
|
@headings[6] = ['###### ', '']
|
||||||
|
|
||||||
|
add_special_RDOCLINK
|
||||||
|
add_special_TIDYLINK
|
||||||
|
|
||||||
@hard_break = " \n"
|
@hard_break = " \n"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -130,5 +133,57 @@ class RDoc::Markup::ToMarkdown < RDoc::Markup::ToRdoc
|
|||||||
@res << "\n" unless @res =~ /\n\z/
|
@res << "\n" unless @res =~ /\n\z/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Creates a Markdown-style URL from +url+ with +text+.
|
||||||
|
|
||||||
|
def gen_url url, text
|
||||||
|
scheme, url, = parse_url url
|
||||||
|
|
||||||
|
"[#{text.sub(%r{^#{scheme}:/*}i, '')}](#{url})"
|
||||||
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Handles <tt>rdoc-</tt> type links for footnotes.
|
||||||
|
|
||||||
|
def handle_rdoc_link url
|
||||||
|
case url
|
||||||
|
when /\Ardoc-ref:/ then
|
||||||
|
$'
|
||||||
|
when /\Ardoc-label:footmark-(\d+)/ then
|
||||||
|
"[^#{$1}]:"
|
||||||
|
when /\Ardoc-label:foottext-(\d+)/ then
|
||||||
|
"[^#{$1}]"
|
||||||
|
when /\Ardoc-label:label-/ then
|
||||||
|
gen_url url, $'
|
||||||
|
when /\Ardoc-[a-z]+:/ then
|
||||||
|
$'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Converts the RDoc markup tidylink into a Markdown.style link.
|
||||||
|
|
||||||
|
def handle_special_TIDYLINK special
|
||||||
|
text = special.text
|
||||||
|
|
||||||
|
return text unless text =~ /\{(.*?)\}\[(.*?)\]/ or text =~ /(\S+)\[(.*?)\]/
|
||||||
|
|
||||||
|
label = $1
|
||||||
|
url = $2
|
||||||
|
|
||||||
|
if url =~ /^rdoc-label:foot/ then
|
||||||
|
handle_rdoc_link url
|
||||||
|
else
|
||||||
|
gen_url url, label
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Converts the rdoc-...: links into a Markdown.style links.
|
||||||
|
|
||||||
|
def handle_special_RDOCLINK special
|
||||||
|
handle_rdoc_link special.text
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -394,11 +394,12 @@ end
|
|||||||
# Adds footnote +content+ to the document
|
# Adds footnote +content+ to the document
|
||||||
|
|
||||||
def add_footnote content
|
def add_footnote content
|
||||||
index = @footnotes.length + 1
|
index = @footnotes.length / 2 + 1
|
||||||
|
|
||||||
footmark_link = "{^#{index}}[rdoc-label:footmark-#{index}:foottext-#{index}]"
|
footmark_link = "{^#{index}}[rdoc-label:footmark-#{index}:foottext-#{index}]"
|
||||||
|
|
||||||
@footnotes << RDoc::Markup::Paragraph.new(footmark_link, *content)
|
@footnotes << RDoc::Markup::Paragraph.new(footmark_link, ' ', *content)
|
||||||
|
@footnotes << RDoc::Markup::BlankLine.new
|
||||||
|
|
||||||
index
|
index
|
||||||
end
|
end
|
||||||
|
@ -1104,7 +1104,7 @@ def _reduce_101(val, _values, result)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def _reduce_102(val, _values, result)
|
def _reduce_102(val, _values, result)
|
||||||
result = "<tt>#{val[1]}</tt>"
|
result = inline "<tt>#{val[1]}</tt>", val[1]
|
||||||
|
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
@ -48,6 +48,97 @@ class TestRDocMarkupFormatter < RDoc::TestCase
|
|||||||
@tt = @attributes.bitmap_for :TT
|
@tt = @attributes.bitmap_for :TT
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_class_gen_relative_url
|
||||||
|
def gen(from, to)
|
||||||
|
RDoc::Markup::ToHtml.gen_relative_url from, to
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_equal 'a.html', gen('a.html', 'a.html')
|
||||||
|
assert_equal 'b.html', gen('a.html', 'b.html')
|
||||||
|
|
||||||
|
assert_equal 'd.html', gen('a/c.html', 'a/d.html')
|
||||||
|
assert_equal '../a.html', gen('a/c.html', 'a.html')
|
||||||
|
assert_equal 'a/c.html', gen('a.html', 'a/c.html')
|
||||||
|
end
|
||||||
|
|
||||||
|
def special_names
|
||||||
|
@attribute_manager.special.map do |_, mask|
|
||||||
|
@attributes.as_string mask
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_add_special_RDOCLINK
|
||||||
|
@to.add_special_RDOCLINK
|
||||||
|
|
||||||
|
assert_includes special_names, 'RDOCLINK'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_add_special_TIDYLINK
|
||||||
|
@to.add_special_TIDYLINK
|
||||||
|
|
||||||
|
assert_includes special_names, 'TIDYLINK'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_parse_url
|
||||||
|
scheme, url, id = @to.parse_url 'example/foo'
|
||||||
|
|
||||||
|
assert_equal 'http', scheme
|
||||||
|
assert_equal 'http://example/foo', url
|
||||||
|
assert_equal nil, id
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_parse_url_anchor
|
||||||
|
scheme, url, id = @to.parse_url '#foottext-1'
|
||||||
|
|
||||||
|
assert_equal nil, scheme
|
||||||
|
assert_equal '#foottext-1', url
|
||||||
|
assert_equal nil, id
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_parse_url_link
|
||||||
|
scheme, url, id = @to.parse_url 'link:README.txt'
|
||||||
|
|
||||||
|
assert_equal 'link', scheme
|
||||||
|
assert_equal 'README.txt', url
|
||||||
|
assert_equal nil, id
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_parse_url_link_id
|
||||||
|
scheme, url, id = @to.parse_url 'link:README.txt#label-foo'
|
||||||
|
|
||||||
|
assert_equal 'link', scheme
|
||||||
|
assert_equal 'README.txt#label-foo', url
|
||||||
|
assert_equal nil, id
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_parse_url_rdoc_label
|
||||||
|
scheme, url, id = @to.parse_url 'rdoc-label:foo'
|
||||||
|
|
||||||
|
assert_equal 'link', scheme
|
||||||
|
assert_equal '#foo', url
|
||||||
|
assert_equal nil, id
|
||||||
|
|
||||||
|
scheme, url, id = @to.parse_url 'rdoc-label:foo:bar'
|
||||||
|
|
||||||
|
assert_equal 'link', scheme
|
||||||
|
assert_equal '#foo', url
|
||||||
|
assert_equal ' id="bar"', id
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_parse_url_scheme
|
||||||
|
scheme, url, id = @to.parse_url 'http://example/foo'
|
||||||
|
|
||||||
|
assert_equal 'http', scheme
|
||||||
|
assert_equal 'http://example/foo', url
|
||||||
|
assert_equal nil, id
|
||||||
|
|
||||||
|
scheme, url, id = @to.parse_url 'https://example/foo'
|
||||||
|
|
||||||
|
assert_equal 'https', scheme
|
||||||
|
assert_equal 'https://example/foo', url
|
||||||
|
assert_equal nil, id
|
||||||
|
end
|
||||||
|
|
||||||
def test_convert_tt_special
|
def test_convert_tt_special
|
||||||
converted = @to.convert '<code>AAA</code>'
|
converted = @to.convert '<code>AAA</code>'
|
||||||
|
|
||||||
|
@ -10,19 +10,6 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase
|
|||||||
@to = RDoc::Markup::ToHtml.new @options
|
@to = RDoc::Markup::ToHtml.new @options
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_class_gen_relative_url
|
|
||||||
def gen(from, to)
|
|
||||||
RDoc::Markup::ToHtml.gen_relative_url from, to
|
|
||||||
end
|
|
||||||
|
|
||||||
assert_equal 'a.html', gen('a.html', 'a.html')
|
|
||||||
assert_equal 'b.html', gen('a.html', 'b.html')
|
|
||||||
|
|
||||||
assert_equal 'd.html', gen('a/c.html', 'a/d.html')
|
|
||||||
assert_equal '../a.html', gen('a/c.html', 'a.html')
|
|
||||||
assert_equal 'a/c.html', gen('a.html', 'a/c.html')
|
|
||||||
end
|
|
||||||
|
|
||||||
def accept_blank_line
|
def accept_blank_line
|
||||||
assert_empty @to.res.join
|
assert_empty @to.res.join
|
||||||
end
|
end
|
||||||
|
@ -348,5 +348,36 @@ words words words words
|
|||||||
assert_equal expected, @to.end_accepting
|
assert_equal expected, @to.end_accepting
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_convert_RDOCLINK
|
||||||
|
result = @to.convert 'rdoc-garbage:C'
|
||||||
|
|
||||||
|
assert_equal "C\n", result
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_convert_TIDYLINK
|
||||||
|
result = @to.convert \
|
||||||
|
'{DSL}[http://en.wikipedia.org/wiki/Domain-specific_language]'
|
||||||
|
|
||||||
|
expected = "[DSL](http://en.wikipedia.org/wiki/Domain-specific_language)\n"
|
||||||
|
|
||||||
|
assert_equal expected, result
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_handle_rdoc_link_label_footmark
|
||||||
|
assert_equal '[^1]:', @to.handle_rdoc_link('rdoc-label:footmark-1:x')
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_handle_rdoc_link_label_foottext
|
||||||
|
assert_equal '[^1]', @to.handle_rdoc_link('rdoc-label:foottext-1:x')
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_handle_rdoc_link_label_label
|
||||||
|
assert_equal '[x](#label-x)', @to.handle_rdoc_link('rdoc-label:label-x')
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_handle_rdoc_link_ref
|
||||||
|
assert_equal 'x', @to.handle_rdoc_link('rdoc-ref:x')
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,6 +22,13 @@ class TestRDocParserRd < RDoc::TestCase
|
|||||||
@tempfile.close
|
@tempfile.close
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mu_pp obj
|
||||||
|
s = ''
|
||||||
|
s = PP.pp obj, s
|
||||||
|
s = s.force_encoding Encoding.default_external if defined? Encoding
|
||||||
|
s.chomp
|
||||||
|
end
|
||||||
|
|
||||||
def test_file
|
def test_file
|
||||||
assert_kind_of RDoc::Parser::Text, util_parser('')
|
assert_kind_of RDoc::Parser::Text, util_parser('')
|
||||||
end
|
end
|
||||||
@ -34,9 +41,7 @@ class TestRDocParserRd < RDoc::TestCase
|
|||||||
def test_scan
|
def test_scan
|
||||||
parser = util_parser 'it ((*really*)) works'
|
parser = util_parser 'it ((*really*)) works'
|
||||||
|
|
||||||
expected =
|
expected = doc(para('it <em>really</em> works'))
|
||||||
@RM::Document.new(
|
|
||||||
@RM::Paragraph.new('it <em>really</em> works'))
|
|
||||||
expected.file = @top_level
|
expected.file = @top_level
|
||||||
|
|
||||||
parser.scan
|
parser.scan
|
||||||
|
@ -15,6 +15,23 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
s.chomp
|
s.chomp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_add_footnote
|
||||||
|
index = @block_parser.add_footnote 'context'
|
||||||
|
|
||||||
|
assert_equal 1, index
|
||||||
|
|
||||||
|
expected = [
|
||||||
|
para('{^1}[rdoc-label:footmark-1:foottext-1]', ' ', 'context'),
|
||||||
|
blank_line,
|
||||||
|
]
|
||||||
|
|
||||||
|
assert_equal expected, @block_parser.footnotes
|
||||||
|
|
||||||
|
index = @block_parser.add_footnote 'other'
|
||||||
|
|
||||||
|
assert_equal 2, index
|
||||||
|
end
|
||||||
|
|
||||||
def test_parse_desclist
|
def test_parse_desclist
|
||||||
list = <<-LIST
|
list = <<-LIST
|
||||||
:one
|
:one
|
||||||
@ -25,9 +42,9 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NOTE,
|
list(:NOTE,
|
||||||
@RM::ListItem.new("one", @RM::Paragraph.new("desc one")),
|
item("one", para("desc one")),
|
||||||
@RM::ListItem.new("two", @RM::Paragraph.new("desc two"))))
|
item("two", para("desc two"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -40,9 +57,9 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("one")),
|
item(nil, para("one")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("two"))))
|
item(nil, para("two"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -56,10 +73,10 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("one"),
|
para("one"),
|
||||||
@RM::Paragraph.new("two"))))
|
para("two"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -74,8 +91,8 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new(*contents))))
|
item(nil, para(*contents))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -88,10 +105,10 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("item"),
|
para("item"),
|
||||||
@RM::Verbatim.new("verbatim\n"))))
|
verb("verbatim\n"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -105,11 +122,11 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("one"),
|
para("one"),
|
||||||
@RM::Verbatim.new("verbatim\n"),
|
verb("verbatim\n"),
|
||||||
@RM::Paragraph.new("two"))))
|
para("two"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -117,9 +134,10 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
def test_parse_footnote
|
def test_parse_footnote
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::Paragraph.new("{*1}[rdoc-label:foottext-1:footmark-1]"),
|
para("{*1}[rdoc-label:foottext-1:footmark-1]"),
|
||||||
@RM::Rule.new(1),
|
rule(1),
|
||||||
@RM::Paragraph.new("{^1}[rdoc-label:footmark-1:foottext-1]", "text"))
|
para("{^1}[rdoc-label:footmark-1:foottext-1]", " ", "text"),
|
||||||
|
blank_line)
|
||||||
|
|
||||||
assert_equal expected, parse("((-text-))")
|
assert_equal expected, parse("((-text-))")
|
||||||
end
|
end
|
||||||
@ -137,10 +155,10 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::BlankLine.new,
|
blank_line,
|
||||||
@RM::Paragraph.new("include <em>worked</em>"),
|
para("include <em>worked</em>"),
|
||||||
@RM::BlankLine.new,
|
blank_line,
|
||||||
@RM::BlankLine.new)
|
blank_line)
|
||||||
|
|
||||||
Tempfile.open %w[parse_include .rd] do |io|
|
Tempfile.open %w[parse_include .rd] do |io|
|
||||||
io.puts "=begin\ninclude ((*worked*))\n=end"
|
io.puts "=begin\ninclude ((*worked*))\n=end"
|
||||||
@ -155,12 +173,12 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_parse_heading
|
def test_parse_heading
|
||||||
assert_equal doc(@RM::Heading.new(1, "H")), parse("= H")
|
assert_equal doc(head(1, "H")), parse("= H")
|
||||||
assert_equal doc(@RM::Heading.new(2, "H")), parse("== H")
|
assert_equal doc(head(2, "H")), parse("== H")
|
||||||
assert_equal doc(@RM::Heading.new(3, "H")), parse("=== H")
|
assert_equal doc(head(3, "H")), parse("=== H")
|
||||||
assert_equal doc(@RM::Heading.new(4, "H")), parse("==== H")
|
assert_equal doc(head(4, "H")), parse("==== H")
|
||||||
assert_equal doc(@RM::Heading.new(5, "H")), parse("+ H")
|
assert_equal doc(head(5, "H")), parse("+ H")
|
||||||
assert_equal doc(@RM::Heading.new(6, "H")), parse("++ H")
|
assert_equal doc(head(6, "H")), parse("++ H")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_parse_itemlist
|
def test_parse_itemlist
|
||||||
@ -171,9 +189,9 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("one")),
|
item(nil, para("one")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("two"))))
|
item(nil, para("two"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -188,8 +206,8 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new(*contents))))
|
item(nil, para(*contents))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -203,13 +221,13 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("one"),
|
para("one"),
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("inner")))),
|
item(nil, para("inner")))),
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("two"))))
|
para("two"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -223,10 +241,10 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("one"),
|
para("one"),
|
||||||
@RM::Paragraph.new("two"))))
|
para("two"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -239,10 +257,10 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("item"),
|
para("item"),
|
||||||
@RM::Verbatim.new("verbatim\n"))))
|
verb("verbatim\n"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -256,11 +274,11 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("one"),
|
para("one"),
|
||||||
@RM::Verbatim.new("verbatim\n"),
|
verb("verbatim\n"),
|
||||||
@RM::Paragraph.new("two"))))
|
para("two"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -277,15 +295,15 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("one")),
|
item(nil, para("one")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("two"))),
|
item(nil, para("two"))),
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("three")),
|
item(nil, para("three")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("four"))),
|
item(nil, para("four"))),
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("five")),
|
item(nil, para("five")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("six"))))
|
item(nil, para("six"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -302,15 +320,15 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("one")),
|
item(nil, para("one")),
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("two"),
|
para("two"),
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("three")),
|
item(nil, para("three")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("four")))),
|
item(nil, para("four")))),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("five")),
|
item(nil, para("five")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("six"))))
|
item(nil, para("six"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -328,16 +346,16 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("one")),
|
item(nil, para("one")),
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("two"),
|
para("two"),
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("three")),
|
item(nil, para("three")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("four"))),
|
item(nil, para("four"))),
|
||||||
@RM::Verbatim.new("verbatim\n")),
|
verb("verbatim\n")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("five")),
|
item(nil, para("five")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("six"))))
|
item(nil, para("six"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -355,16 +373,16 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:NUMBER,
|
list(:NUMBER,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("one")),
|
item(nil, para("one")),
|
||||||
@RM::ListItem.new(nil,
|
item(nil,
|
||||||
@RM::Paragraph.new("two"),
|
para("two"),
|
||||||
@RM::List.new(:BULLET,
|
list(:BULLET,
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("three")),
|
item(nil, para("three")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("four"))),
|
item(nil, para("four"))),
|
||||||
@RM::Verbatim.new("verbatim\n")),
|
verb("verbatim\n")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("five")),
|
item(nil, para("five")),
|
||||||
@RM::ListItem.new(nil, @RM::Paragraph.new("six"))))
|
item(nil, para("six"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -380,13 +398,13 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:LABEL,
|
list(:LABEL,
|
||||||
@RM::ListItem.new(
|
item(
|
||||||
"<tt>Array#each {|i| ... }</tt>",
|
"<tt>Array#each {|i| ... }</tt>",
|
||||||
@RM::Paragraph.new("yield block for each item.")),
|
para("yield block for each item.")),
|
||||||
@RM::ListItem.new(
|
item(
|
||||||
"<tt>Array#index(val)</tt>",
|
"<tt>Array#index(val)</tt>",
|
||||||
@RM::Paragraph.new("return index of first item which equals with val. if it hasn't same item, return nil."))))
|
para("return index of first item which equals with val. if it hasn't same item, return nil."))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -399,8 +417,8 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:LABEL,
|
list(:LABEL,
|
||||||
@RM::ListItem.new("<tt>A#b</tt>")))
|
item("<tt>A#b</tt>")))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -414,10 +432,10 @@ class TestRDocRdBlockParser < RDoc::TestCase
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:LABEL,
|
list(:LABEL,
|
||||||
@RM::ListItem.new(
|
item(
|
||||||
"<tt>A#b</tt>",
|
"<tt>A#b</tt>",
|
||||||
@RM::Paragraph.new("one"))))
|
para("one"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -432,11 +450,11 @@ two
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:LABEL,
|
list(:LABEL,
|
||||||
@RM::ListItem.new(
|
item(
|
||||||
"<tt>A#b</tt>",
|
"<tt>A#b</tt>",
|
||||||
@RM::Paragraph.new("one"))),
|
para("one"))),
|
||||||
@RM::Paragraph.new("two"))
|
para("two"))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
@ -451,21 +469,21 @@ two
|
|||||||
|
|
||||||
expected =
|
expected =
|
||||||
doc(
|
doc(
|
||||||
@RM::List.new(:LABEL,
|
list(:LABEL,
|
||||||
@RM::ListItem.new(
|
item(
|
||||||
"<tt>A#b</tt>",
|
"<tt>A#b</tt>",
|
||||||
@RM::Paragraph.new("text"),
|
para("text"),
|
||||||
@RM::Verbatim.new("verbatim\n"))))
|
verb("verbatim\n"))))
|
||||||
|
|
||||||
assert_equal expected, parse(list)
|
assert_equal expected, parse(list)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_parse_verbatim
|
def test_parse_verbatim
|
||||||
assert_equal doc(@RM::Verbatim.new("verbatim\n")), parse(" verbatim")
|
assert_equal doc(verb("verbatim\n")), parse(" verbatim")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_parse_verbatim_blankline
|
def test_parse_verbatim_blankline
|
||||||
expected = doc(@RM::Verbatim.new("one\n", "\n", "two\n"))
|
expected = doc(verb("one\n", "\n", "two\n"))
|
||||||
|
|
||||||
verbatim = <<-VERBATIM
|
verbatim = <<-VERBATIM
|
||||||
one
|
one
|
||||||
@ -477,7 +495,7 @@ two
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_parse_verbatim_indent
|
def test_parse_verbatim_indent
|
||||||
expected = doc(@RM::Verbatim.new("one\n", " two\n"))
|
expected = doc(verb("one\n", " two\n"))
|
||||||
|
|
||||||
verbatim = <<-VERBATIM
|
verbatim = <<-VERBATIM
|
||||||
one
|
one
|
||||||
@ -488,7 +506,7 @@ two
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_parse_verbatim_multi
|
def test_parse_verbatim_multi
|
||||||
expected = doc(@RM::Verbatim.new("one\n", "two\n"))
|
expected = doc(verb("one\n", "two\n"))
|
||||||
|
|
||||||
verbatim = <<-VERBATIM
|
verbatim = <<-VERBATIM
|
||||||
one
|
one
|
||||||
@ -499,11 +517,11 @@ two
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_parse_textblock
|
def test_parse_textblock
|
||||||
assert_equal doc(@RM::Paragraph.new("text")), parse("text")
|
assert_equal doc(para("text")), parse("text")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_parse_textblock_multi
|
def test_parse_textblock_multi
|
||||||
expected = doc(@RM::Paragraph.new("one two"))
|
expected = doc(para("one two"))
|
||||||
|
|
||||||
assert_equal expected, parse("one\ntwo")
|
assert_equal expected, parse("one\ntwo")
|
||||||
end
|
end
|
||||||
@ -513,8 +531,8 @@ two
|
|||||||
|
|
||||||
doc = @block_parser.parse text.lines.to_a
|
doc = @block_parser.parse text.lines.to_a
|
||||||
|
|
||||||
assert_equal @RM::BlankLine.new, doc.parts.shift, "=begin blankline"
|
assert_equal blank_line, doc.parts.shift, "=begin blankline"
|
||||||
assert_equal @RM::BlankLine.new, doc.parts.pop, "=end blankline"
|
assert_equal blank_line, doc.parts.pop, "=end blankline"
|
||||||
|
|
||||||
doc
|
doc
|
||||||
end
|
end
|
||||||
|
@ -26,7 +26,8 @@ class TestRDocRdInlineParser < RDoc::TestCase
|
|||||||
assert_equal '{*1}[rdoc-label:foottext-1:footmark-1]', parse('((-text-))')
|
assert_equal '{*1}[rdoc-label:foottext-1:footmark-1]', parse('((-text-))')
|
||||||
|
|
||||||
expected = [
|
expected = [
|
||||||
@RM::Paragraph.new('{^1}[rdoc-label:footmark-1:foottext-1]', 'text')
|
@RM::Paragraph.new('{^1}[rdoc-label:footmark-1:foottext-1]', ' ', 'text'),
|
||||||
|
blank_line,
|
||||||
]
|
]
|
||||||
|
|
||||||
assert_equal expected, @block_parser.footnotes
|
assert_equal expected, @block_parser.footnotes
|
||||||
@ -161,6 +162,10 @@ class TestRDocRdInlineParser < RDoc::TestCase
|
|||||||
assert_equal '<tt>text "</tt>', parse("(('text \\\"'))")
|
assert_equal '<tt>text "</tt>', parse("(('text \\\"'))")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_parse_verb_emphasis
|
||||||
|
assert_equal '<tt>((*emphasis*))</tt>', parse("(('((*emphasis*))'))")
|
||||||
|
end
|
||||||
|
|
||||||
def test_parse_verb_multiple
|
def test_parse_verb_multiple
|
||||||
assert_equal '<tt>((*text*))</tt>', parse("(('((*text*))'))")
|
assert_equal '<tt>((*text*))</tt>', parse("(('((*text*))'))")
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user