Add local file support.
Example of absolute path to local file. ```html:/home``` Example of relative path to local file. ```html:home``` 1.8.7 string fix. 's'[0..0] instead of 's'[0] Fix regex. Add absolute and relative tests.
This commit is contained in:
@@ -495,6 +495,35 @@ np.array([[2,2],[1,3]],np.float)
|
||||
assert_match /\(\[\[/, rendered, "#{markup_class} parses out wiki links\n#{rendered}"
|
||||
end
|
||||
|
||||
test "embed code is escaped" do
|
||||
@wiki.write_page("script", :markdown, "a <script></script> b", commit_details)
|
||||
@wiki.write_page("page", :markdown, "```html:script```", commit_details)
|
||||
|
||||
output_script = @wiki.page("script").formatted_data
|
||||
output_page = @wiki.page("page").formatted_data
|
||||
|
||||
assert_equal %Q{<p>a b</p>}, output_script
|
||||
assert_equal %Q{<div class=\"highlight\">\n<pre><span class=\"nt\"><p></span>a b<span class=\"nt\"></p></span>\n</pre>\n</div>\n}, output_page
|
||||
end
|
||||
|
||||
test "embed code page absolute link" do
|
||||
@wiki.write_page("base", :markdown, "a\n!base\b", commit_details)
|
||||
@wiki.write_page("a", :markdown, "a\n```html:/base```\b", commit_details)
|
||||
|
||||
page = @wiki.page("a")
|
||||
output = page.formatted_data
|
||||
assert_equal %Q{<p>a\n</p><div class=\"highlight\">\n<pre><span class=\"nt\"><p></span>a\n!base<span class=\"nt\"></p></span>\n</pre>\n</div>\n\n}, output
|
||||
end
|
||||
|
||||
test "embed code page relative link" do
|
||||
@wiki.write_page("base", :markdown, "a\n!rel\b", commit_details)
|
||||
@wiki.write_page("a", :markdown, "a\n```html:base```\b", commit_details)
|
||||
|
||||
page = @wiki.page("a")
|
||||
output = page.formatted_data
|
||||
assert_equal %Q{<p>a\n</p><div class=\"highlight\">\n<pre><span class=\"nt\"><p></span>a\n!rel<span class=\"nt\"></p></span>\n</pre>\n</div>\n\n}, output
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Web Sequence Diagrams
|
||||
|
||||
Reference in New Issue
Block a user