Class ContentManager
java.lang.Object
com.wontlost.ckeditor.internal.ContentManager
Internal class for managing editor content.
Handles content retrieval, setting, sanitization, and transformation.
This class is an internal API and should not be used directly by external code.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCharacterCount(String html) Estimate the character count of the content (excluding HTML tags).getPlainText(String html) Convert HTML to plain text.getSanitizedHtml(String html) Sanitize HTML using relaxed rules.getSanitizedValue(String html) Get sanitized HTML content.intgetWordCount(String html) Estimate the word count of the content.booleanisContentEmpty(String html) Check whether the content is empty.normalizeForComparison(String html) Normalize HTML content for comparison.sanitizeHtml(String html, org.jsoup.safety.Safelist safelist) Sanitize HTML using custom rules.
-
Constructor Details
-
ContentManager
Create a content manager.- Parameters:
htmlSanitizer- HTML sanitizer, may be null
-
-
Method Details
-
getSanitizedValue
-
getPlainText
-
getSanitizedHtml
-
sanitizeHtml
-
normalizeForComparison
-
isContentEmpty
Check whether the content is empty.- Parameters:
html- HTML content- Returns:
- true if the content is empty or contains only whitespace tags
-
getCharacterCount
Estimate the character count of the content (excluding HTML tags).- Parameters:
html- HTML content- Returns:
- character count
-
getWordCount
Estimate the word count of the content.- Parameters:
html- HTML content- Returns:
- word count
-