X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=90249d3aaa941b847cccbd0e00c45d0e8488c4c2;hp=98539fe596acfbaf30c2b6a2c0697c4fbb0dfc33;hb=9a51be48388d6f94c692444e986a616e52b5909d;hpb=b1ad350c14abb8614913ef0ff0a64eeb1f402934 diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index 98539fe..90249d3 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -58,6 +58,7 @@ import net.pterodactylus.sone.template.SoneAccessor; import net.pterodactylus.sone.template.SubstringFilter; import net.pterodactylus.sone.template.TrustAccessor; import net.pterodactylus.sone.template.UnknownDateFilter; +import net.pterodactylus.sone.text.SoneTextParser; import net.pterodactylus.sone.web.ajax.BookmarkAjaxPage; import net.pterodactylus.sone.web.ajax.CreatePostAjaxPage; import net.pterodactylus.sone.web.ajax.CreateReplyAjaxPage; @@ -151,6 +152,9 @@ public class WebInterface implements CoreListener { /** The template context factory. */ private final TemplateContextFactory templateContextFactory; + /** The Sone text parser. */ + private final SoneTextParser soneTextParser; + /** The “new Sone” notification. */ private final ListNotification newSoneNotification; @@ -185,6 +189,7 @@ public class WebInterface implements CoreListener { public WebInterface(SonePlugin sonePlugin) { this.sonePlugin = sonePlugin; formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword(); + soneTextParser = new SoneTextParser(getCore()); templateContextFactory = new TemplateContextFactory(); templateContextFactory.addAccessor(Object.class, new ReflectionAccessor()); @@ -206,7 +211,7 @@ public class WebInterface implements CoreListener { templateContextFactory.addFilter("match", new MatchFilter()); templateContextFactory.addFilter("css", new CssClassNameFilter()); templateContextFactory.addFilter("js", new JavascriptFilter()); - templateContextFactory.addFilter("parse", new ParserFilter(getCore(), templateContextFactory)); + templateContextFactory.addFilter("parse", new ParserFilter(getCore(), templateContextFactory, soneTextParser)); templateContextFactory.addFilter("unknown", new UnknownDateFilter(getL10n(), "View.Sone.Text.UnknownDate")); templateContextFactory.addFilter("format", new FormatFilter()); templateContextFactory.addFilter("sort", new CollectionSortFilter());