|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectgriffon.plugins.markdown.MarkdownProcessor
class MarkdownProcessor extends Object
| Field Summary | |
|---|---|
private String |
baseUri
|
private static int |
pegdownExtensions
|
private org.pegdown.PegDownProcessor |
processor
|
private ReentrantLock |
processorLock
|
private com.overzealous.remark.Remark |
remark
|
private static com.overzealous.remark.Options |
remarkOptions
|
| Constructor Summary | |
MarkdownProcessor()
|
|
| Method Summary | |
|---|---|
private static Map
|
getConfigurations(Map conf)
|
org.pegdown.PegDownProcessor
|
getProcessor(Map conf = null)
Returns or creates the Pegdown processor instance used for conversion |
com.overzealous.remark.Remark
|
getRemark(Map conf = [:])
Returns or creates the Remark instance used for conversion |
String
|
htmlToMarkdown(String text, String customBaseUri = '', Map conf = null)
Converts the provided HTML back to Markdown |
String
|
markdownToHtml(String text, Map conf = null)
Converts the provided Markdown into HTML |
String
|
sanitize(String text, Map conf = null)
Utility method to strip untrusted HTML from markdown input. |
private void
|
setupConfigurations()
|
| Methods inherited from class Object | |
|---|---|
| notify, notifyAll, wait, wait, wait, equals, toString, hashCode, getClass |
| Field Detail |
|---|
private String baseUri
private static int pegdownExtensions
private org.pegdown.PegDownProcessor processor
private final ReentrantLock processorLock
private com.overzealous.remark.Remark remark
private static com.overzealous.remark.Options remarkOptions
| Constructor Detail |
|---|
MarkdownProcessor()
| Method Detail |
|---|
private static Map getConfigurations(Map conf)
org.pegdown.PegDownProcessor getProcessor(Map conf = null)
conf - Optional configuration Map to create a custom processor
com.overzealous.remark.Remark getRemark(Map conf = [:])
conf - Optional configuration Map to create a custom remark.
String htmlToMarkdown(String text, String customBaseUri = '', Map conf = null)
By default this method uses the shared configuration. However, the default configuration can be overridden by passing in a map or map-like object as the second argument. With a custom configuration, a new Remark is created every call to this method!
text - HTML-formatted textcustomBaseUri - Override the default base URLconf - If provided, creates a custom remark with unique settings just for this instance
String markdownToHtml(String text, Map conf = null)
By default this method uses the shared configuration. However, the default configuration can be overridden by passing in a map or map-like object as the second argument. With a custom configuration, a new Pegdown processor is created every call to this method!
text - Markdown-formatted textconf - If provided, creates a custom pegdown with unique settings just for this instance
String sanitize(String text, Map conf = null)
Works by simply running the text through pegdown and back through remark.
By default this method uses the shared configuration. However, the default configuration can be overridden by passing in a map or map-like object as the second argument. With a custom configuration, new processing engines are created every call to this method!
text - Markdown-formatted textconf - If provided, creates custom remark and pegdown with unique settings for this instance
private void setupConfigurations()
Groovy Documentation