Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupJSONField ¶
CleanupJSONField converts a text to a json friendly text as follows: - converts multi-line fields to single line by removing all but the first line - escapes special characters - truncates remaining line to length no more than maxSummaryLength
func CleanupNewLines ¶
func ReplaceMarkedFields ¶
func ReplaceMarkedFields(str, startMarker, endMarker string, fieldReplacer func(string) string) (newStr string, err error)
ReplaceMarkedFields finds substrings delimited by the start and end markers, removes the markers, and replaces the text between the markers with the result of calling the fieldReplacer function on that text substring. For example, if the input string is: "a string with <a>text</a> marked" the startMarker is: "<a>" the end marker is: "</a>" and fieldReplacer is: strings.ToUpper then the output will be: "a string with TEXT marked"
Types ¶
This section is empty.