///
import { sanitize } from 'angular';
export default class RichTextService {
private $sanitize;
constructor($sanitize: sanitize.ISanitizeService);
/** Older versions of Quill rendered some things differently. Patch those up. */
backwardsCompatibleHtml(html: string): string;
/**
* Transform
- into
- ,
* and
- into
-
* accounting for any pattern of nested
and tags.
*/
fixBulletPoints(html: string): string;
/**
* Transform tags from the old Quill editor into tags, as used by the new editor.
* Quill used to set fonts using
* Now it uses
* Although the former still renders correctly, it is skipped for editor.getText(), so it might report that the text editor is empty.
*/
fixFontTags(html: string): string;
/**
* Quill adds its own editor cursor to its HTML: |
* These days we remove that on save, but sometimes it's present in the HTML that was saved by an older version of the editor.
* In rare cases, the HTML wraps that span around actual content. This function fixes that.
*/
fixWrappingCursor(html: string): string;
/**
* To transition to supporting Google font weights, we switched to inline font weights rather than quill's default tags.
* Replace the legacy strong's with regular span's and an inline font weight.
*/
fixStrongBold(html: string): string;
/** Helper method because regexes can't natively start searching from a given index */
indexOfRegex(text: string, regex: RegExp, fromIndex: number): number;
/** Sometimes Quill's HTML includes its own cursor. We don't want to save that. */
removeCursor(html: string): string;
/** Sometimes Quill adds Zero Width No-Break Spaces. */
removeZeroWidthNoBreakSpaces(html: string): string;
/** Clean up the HTML, ready for save */
sanitizeHtml(html: string): string;
}