Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
var source = ctx.opt_source.value
if source == null then
var url = location.file.filename.simplify_path
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")
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
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
end
# MProject description template
# Link href
var href: String is writable
# 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
var text: Streamable is writable
+ # The unescaped optional title.
var title: nullable String = null is writable
init with_title(href, text, title: String) do
var title: nullable String = null is writable
init with_title(href, text, title: String) do
redef fun rendering do
add "<a href=\""
redef fun rendering do
add "<a href=\""
add "\""
if title != null then
add " title=\""
add "\""
if title != null then
add " title=\""
+ add title.as(not null).html_escape