var source = ctx.opt_source.value
if source == null then
var url = location.file.filename.simplify_path
- return "<a target='_blank' title='Show source' href=\"{url}\">View Source</a>"
+ return "<a target='_blank' title='Show source' href=\"{url.html_escape}\">View Source</a>"
end
# THIS IS JUST UGLY ! (but there is no replace yet)
var x = source.split_with("%f")
x = source.split_with("%L")
source = x.join(location.line_end.to_s)
source = source.simplify_path
- return "<a target='_blank' title='Show source' href=\"{source.to_s}\">View Source</a>"
+ return "<a target='_blank' title='Show source' href=\"{source.to_s.html_escape}\">View Source</a>"
end
# MProject description template
# Link href
var href: String is writable
- # Text to display in the link
+ # The raw HTML content to display in the link
var text: Streamable is writable
- # Optional title
+ # The unescaped optional title.
var title: nullable String = null is writable
init with_title(href, text, title: String) do
redef fun rendering do
add "<a href=\""
- add href
+ add href.html_escape
add "\""
if title != null then
add " title=\""
- add title.as(not null)
+ add title.as(not null).html_escape
add "\""
end
add ">"