lucee.Component
commandbox.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
|
configService
|
true
|
false
|
|
any
|
JSONPrettyPrint
|
true
|
false
|
|
any
|
print
|
true
|
false
|
|
any
|
shell
|
true
|
false
|
|
| Constructor Summary | |
|---|---|
|
init()
Constructor. |
|
| Method Summary | |
|---|---|
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
|
HTML2ANSI(any html, [any additionalFormatting=''])
Converts HTML into ANSI text. |
any
|
MD2ANSI(any markdown, [any additionalFormatting=''])
Converts markdown into ANSI text. |
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 - ConfigServiceserializable - trueaccess - publicrequired - falsereturntype - anyinject - provider:JSONPrettyPrintserializable - trueaccess - publicrequired - falsereturntype - anyinject - printserializable - trueaccess - publicrequired - falsereturntype - anyinject - shellserializable - true| Method Detail |
|---|
Converts HTML matches into ANSI text
text - HTML to converttag - HTML tag name to replaceansiCode - ANSI code to replace tag withadditionalFormattingPretty JSON
json - A string containing JSON, or a complex value that can be serialized to JSONindentlineEndingspaceAfterColonsortKeysansiColorsConverts HTML into ANSI text
html - HTML to convertadditionalFormattingConverts markdown into ANSI text
markdown - Text to convertadditionalFormattingCreate 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