From 8addd2074dbb2df905d40690f064fb3064acf788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 1 Apr 2021 08:56:57 +0200 Subject: [PATCH] MOBILE-3657 text: Add CoreTextFormat enum --- src/core/services/utils/text.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/core/services/utils/text.ts b/src/core/services/utils/text.ts index a7f8013ca..aba818639 100644 --- a/src/core/services/utils/text.ts +++ b/src/core/services/utils/text.ts @@ -1097,6 +1097,7 @@ export class CoreTextUtilsProvider { } } +export const CoreTextUtils = makeSingleton(CoreTextUtilsProvider); /** * Options for viewText. @@ -1113,4 +1114,15 @@ export type CoreTextUtilsViewTextOptions = { modalOptions?: Partial; // Modal options. }; -export const CoreTextUtils = makeSingleton(CoreTextUtilsProvider); +/** + * Define text formatting types. + */ +export enum CoreTextFormat { + FORMAT_MOODLE = 0, // Does all sorts of transformations and filtering. + FORMAT_HTML = 1, // Plain HTML (with some tags stripped). Use it by default. + FORMAT_PLAIN = 2, // Plain text (even tags are printed in full). + // FORMAT_WIKI is deprecated since 2005... + FORMAT_MARKDOWN = 4, // Markdown-formatted text http://daringfireball.net/projects/markdown/ +} + +export const defaultTextFormat = CoreTextFormat.FORMAT_HTML;