-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/com/hubspot/jinjava/lib/filter/CloseHtmlFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.hubspot.jinjava.lib.filter; | ||
|
||
import com.hubspot.jinjava.doc.annotations.JinjavaDoc; | ||
import com.hubspot.jinjava.doc.annotations.JinjavaParam; | ||
import com.hubspot.jinjava.doc.annotations.JinjavaSnippet; | ||
import com.hubspot.jinjava.interpret.JinjavaInterpreter; | ||
|
||
@JinjavaDoc( | ||
value = "Closes open HTML tags in a string", | ||
input = @JinjavaParam(value = "s", desc = "String to close", required = true), | ||
snippets = { | ||
@JinjavaSnippet( | ||
code = "{{ \"<p> Hello, world\"|closehtml }}" | ||
) | ||
} | ||
) | ||
public class CloseHtmlFilter implements Filter{ | ||
|
||
@Override | ||
public String getName() { | ||
return "render"; | ||
} | ||
|
||
@Override | ||
public Object filter(Object var, JinjavaInterpreter interpreter, String... args) { | ||
/* | ||
Closes open HTML tags. | ||
*/ | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters