lib/trac-wiki/parser.rb in trac-wiki-0.3.33 vs lib/trac-wiki/parser.rb in trac-wiki-0.3.34
- old
+ new
@@ -56,10 +56,11 @@
# },
# ...
# ]
attr_accessor :headings
attr_accessor :env
+ attr_accessor :base_url
attr_reader :used_templates
@used_templates = {}
@@ -160,12 +161,13 @@
return self
end
def was_math?; @was_math; end
- def to_html(text = nil)
+ def to_html(text = nil, base_url = '')
text(text) if ! text.nil?
+ @base_url = base_url
@used_templates = {}
@was_math = false
@anames = {}
@count_lines_level = 0
@text = text if !text.nil?
@@ -474,10 +476,10 @@
end
@tree.tag_end(hN)
end
def edit_heading_link(section)
- @tree.tag(:a, { class: @edit_heading_class, id:"h#{section}", href: "?edit=#{section}"}, "edit")
+ @tree.tag(:a, { class: @edit_heading_class, id:"h#{section}", href: "#{@base_url}?edit=#{section}"}, "edit")
end
def make_explicit_link(link)
begin
uri = URI.parse(link)