lucee.Componentcommandbox.system.util.Formatter
Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com Utilities for dealing with formmating HTML and ANSI output
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
JSONPrettyPrint
|
true
|
false
|
|
any
|
configService
|
true
|
false
|
|
any
|
print
|
true
|
false
|
|
any
|
shell
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
any
|
HTML2ANSI(any html, [any additionalFormatting=''])
Converts HTML into ANSI text. |
any
|
MD2ANSI(any markdown, [any additionalFormatting=''])
Converts markdown into ANSI text. |
any
|
ansifyHTML([any text], [any tag], [any ansiCode], [any additionalFormatting])
Converts HTML matches into ANSI text. |
any
|
formatJson([any json], [string indent], [string lineEnding], [boolean spaceAfterColon], [string sortKeys], [struct ansiColors])
Pretty JSON. |
any
|
slugify(any str, [numeric maxLength='0'], [any allow=''])
Create a URL safe slug from a string. |
any
|
unescapeHTML(any html)
Converts HTML into plain text. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyinject
- provider:JSONPrettyPrintserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- ConfigServiceserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- printserializable
- trueaccess
- publicrequired
- falsereturntype
- anyinject
- shellserializable
- trueMethod Detail |
---|
Converts HTML into ANSI text
html
- HTML to convertadditionalFormatting
Converts markdown into ANSI text
markdown
- Text to convertadditionalFormatting
Converts HTML matches into ANSI text
text
- HTML to converttag
- HTML tag name to replaceansiCode
- ANSI code to replace tag withadditionalFormatting
Pretty JSON
json
- A string containing JSON, or a complex value that can be serialized to JSONindent
lineEnding
spaceAfterColon
sortKeys
ansiColors
Create a URL safe slug from a string
str
- The string to slugifymaxLength
- The maximum number of characters for the slugallow
- A regex safe list of additional characters to allowConverts HTML into plain text
html
- HTML to convert