fix markup formatting edge case
This commit is contained in:
@@ -179,6 +179,8 @@ module Gollum
|
|||||||
# if it is not.
|
# if it is not.
|
||||||
def process_image_tag(tag)
|
def process_image_tag(tag)
|
||||||
parts = tag.split('|')
|
parts = tag.split('|')
|
||||||
|
return if parts.size.zero?
|
||||||
|
|
||||||
name = parts[0].strip
|
name = parts[0].strip
|
||||||
path = if file = find_file(name)
|
path = if file = find_file(name)
|
||||||
::File.join @wiki.base_path, file.path
|
::File.join @wiki.base_path, file.path
|
||||||
@@ -267,6 +269,8 @@ module Gollum
|
|||||||
# if it is not.
|
# if it is not.
|
||||||
def process_file_link_tag(tag)
|
def process_file_link_tag(tag)
|
||||||
parts = tag.split('|')
|
parts = tag.split('|')
|
||||||
|
return if parts.size.zero?
|
||||||
|
|
||||||
name = parts[0].strip
|
name = parts[0].strip
|
||||||
path = parts[1] && parts[1].strip
|
path = parts[1] && parts[1].strip
|
||||||
path = if path && file = find_file(path)
|
path = if path && file = find_file(path)
|
||||||
|
|||||||
@@ -446,6 +446,18 @@ context "Markup" do
|
|||||||
compare(content, output, 'org')
|
compare(content, output, 'org')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "short double links" do
|
||||||
|
content = "a [[b]] c"
|
||||||
|
output = %(<p class="title">a <a class="internal absent" href="/b">b</a> c</p>)
|
||||||
|
compare(content, output, 'org')
|
||||||
|
end
|
||||||
|
|
||||||
|
test "double linked pipe" do
|
||||||
|
content = "a [[|]] b"
|
||||||
|
output = %(<p class="title">a <a class="internal absent" href="/"></a> b</p>)
|
||||||
|
compare(content, output, 'org')
|
||||||
|
end
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
#
|
#
|
||||||
# TeX
|
# TeX
|
||||||
|
|||||||
Reference in New Issue
Block a user