Class TextileFilter
java.lang.Object
org.shredzone.commons.text.filter.TextileFilter
- All Implemented Interfaces:
Function<CharSequence,CharSequence>
,TextFilter
A filter that converts Textile markup to HTML.
Currently, Mylyn WikiText Textile (formerly known as Textile-J) is used for conversion. Future releases may come with an own, lightweight implementation.
- Author:
- Richard "Shred" Körber
- See Also:
- Mylyn WikiText
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply(CharSequence text)
Applies the filter on aCharSequence
and returns a newCharSequence
with the modified text.protected org.eclipse.mylyn.wikitext.parser.DocumentBuilder
createDocumentBuilder(Writer writer)
Creates a Textile-jDocumentBuilder
to be used for writing.void
setAnalyzer(LinkAnalyzer analyzer)
Sets aLinkAnalyzer
to be used for converting links and image source URLs.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.shredzone.commons.text.TextFilter
toStringBuilder
-
Constructor Details
-
TextileFilter
public TextileFilter()
-
-
Method Details
-
setAnalyzer
Sets aLinkAnalyzer
to be used for converting links and image source URLs.- Parameters:
analyzer
-LinkAnalyzer
to be used
-
createDocumentBuilder
Creates a Textile-jDocumentBuilder
to be used for writing.Note that this method is Textile-j specific and might be removed in future versions.
- Parameters:
writer
-Writer
to write the HTML output to- Returns:
DocumentBuilder
to be used for the markup parser
-
apply
Description copied from interface:TextFilter
Applies the filter on aCharSequence
and returns a newCharSequence
with the modified text.- Specified by:
apply
in interfaceFunction<CharSequence,CharSequence>
- Specified by:
apply
in interfaceTextFilter
- Parameters:
text
-CharSequence
with the contents to be filtered. If this is aStringBuilder
instance, its contents may have changed after invocation, and this instance should not be used any more.- Returns:
CharSequence
with the filtered text.
-