|
|
@ -252,6 +252,7 @@ Glib::ustring Reader::Make::link( |
|
|
|
const Glib::ustring & DATE, |
|
|
|
const Glib::ustring & DATE, |
|
|
|
const Glib::ustring & ALT |
|
|
|
const Glib::ustring & ALT |
|
|
|
) { |
|
|
|
) { |
|
|
|
|
|
|
|
// Compose link description using optional date/alt values
|
|
|
|
Glib::ustring description; |
|
|
|
Glib::ustring description; |
|
|
|
|
|
|
|
|
|
|
|
if (!DATE.empty()) |
|
|
|
if (!DATE.empty()) |
|
|
@ -264,19 +265,22 @@ Glib::ustring Reader::Make::link( |
|
|
|
if (!ALT.empty()) |
|
|
|
if (!ALT.empty()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
description.append( |
|
|
|
description.append( |
|
|
|
description.empty() ? ALT : description + " " + ALT // append (to date)
|
|
|
|
description.empty() ? ALT : description + " " + ALT |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Glib::ustring::sprintf( |
|
|
|
// Make relative links absolute using base given
|
|
|
|
"<a href=\"%s\" title=\"%s\">%s</a>\n", |
|
|
|
const auto ABSOLUTE = g_uri_resolve_relative( |
|
|
|
Glib::Markup::escape_text( |
|
|
|
|
|
|
|
g_uri_resolve_relative( |
|
|
|
|
|
|
|
BASE.c_str(), |
|
|
|
BASE.c_str(), |
|
|
|
ADDRESS.c_str(), |
|
|
|
ADDRESS.c_str(), |
|
|
|
G_URI_FLAGS_NONE, |
|
|
|
G_URI_FLAGS_NONE, |
|
|
|
NULL // GError * @TODO
|
|
|
|
NULL // GError * @TODO
|
|
|
|
) |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Glib::ustring::sprintf( |
|
|
|
|
|
|
|
"<a href=\"%s\" title=\"%s\">%s</a>\n", |
|
|
|
|
|
|
|
Glib::Markup::escape_text( |
|
|
|
|
|
|
|
ABSOLUTE == NULL ? ADDRESS : ABSOLUTE // @TODO exception?
|
|
|
|
), |
|
|
|
), |
|
|
|
Glib::Markup::escape_text( |
|
|
|
Glib::Markup::escape_text( |
|
|
|
ADDRESS |
|
|
|
ADDRESS |
|
|
|