Class Nl2brHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.utility.Nl2brHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class Nl2brHandlebarsHelper extends BaseHelper
The {{nlbr ...}} handlebars helper is used to replace new lines with <br /> tags in the current evaluation context.Usage
The {{nlbr ...}} handlebars helper is used to replace new lines with <br /> tags in the current evaluation context.
This will generally be used in conjunction with text, such as that from Plain Text Content Elements.
Example
{{nl2br (publish element="Plain Text")}}
In the above example, new line characters will be replaced in the text that is returned from the publish helper.
-
-
Constructor Summary
Constructors Constructor Description Nl2brHandlebarsHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Method Detail
-
apply
public String apply(Object context, com.github.jknack.handlebars.Options options)
Description copied from class:BaseHelper
Theapply
method is the main entry point for handlebars.java helpers.It is called internally by the handlebars.java engine when a matching handlebars.java expression is encountered.
- Specified by:
apply
in interfacecom.github.jknack.handlebars.Helper<Object>
- Specified by:
apply
in classBaseHelper
- Parameters:
context
- The currently executing context.options
- The options.- Returns:
- The generated output.
-
-