- return new TemplatePart(templateFactory.createTemplate(new StringReader("<a class=\"freenet-trusted\" href=\"/<% link|html>\" title=\"<% link|html>\"><% name|html></a>"))).set("link", link).set("name", name);
+ return new TemplatePart(templateContextFactory, TemplateParser.parse(new StringReader("<a class=\"freenet-trusted\" href=\"/<% link|html>\" title=\"<% link|html>\"><% name|html></a>"))).set("link", link).set("name", name);
+ }
+
+ /**
+ * Creates a new part based on a template that links to a page in Sone.
+ *
+ * @param link
+ * The target of the link
+ * @param name
+ * The name of the link
+ * @return The part that displays the link
+ */
+ private Part createInSoneLinkPart(String link, String name) {
+ return createInSoneLinkPart(link, name, name);
+ }
+
+ /**
+ * Creates a new part based on a template that links to a page in Sone.
+ *
+ * @param link
+ * The target of the link
+ * @param name
+ * The name of the link
+ * @param title
+ * The title attribute of the link
+ * @return The part that displays the link
+ */
+ private Part createInSoneLinkPart(String link, String name, String title) {
+ return new TemplatePart(templateContextFactory, TemplateParser.parse(new StringReader("<a class=\"in-sone\" href=\"<%link|html>\" title=\"<%title|html>\"><%name|html></a>"))).set("link", link).set("name", name).set("title", title);