commit
cb10f9e25d
|
@ -621,6 +621,9 @@ class behat_app extends behat_app_helper {
|
|||
});
|
||||
|
||||
$this->wait_for_pending_js();
|
||||
|
||||
// Wait for UI to settle after refreshing.
|
||||
$this->getSession()->wait(300);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -181,7 +181,7 @@ export class AddonModBBBIndexComponent extends CoreCourseModuleMainActivityCompo
|
|||
return {
|
||||
type: playbackAnchor?.innerText ??
|
||||
Translate.instant('addon.mod_bigbluebuttonbn.view_recording_format_presentation'),
|
||||
name: CoreTextUtils.cleanTags(String(recordingData.recording), true),
|
||||
name: CoreTextUtils.cleanTags(String(recordingData.recording), { singleLine: true }),
|
||||
url: playbackAnchor?.href ?? '',
|
||||
details,
|
||||
expanded: false,
|
||||
|
|
|
@ -87,7 +87,7 @@ export class AddonModWikiEditPage implements OnInit, OnDestroy, CanLeave {
|
|||
this.userId = CoreNavigator.getRouteNumberParam('userId');
|
||||
|
||||
let pageTitle = CoreNavigator.getRouteParam<string>('pageTitle');
|
||||
pageTitle = pageTitle ? CoreTextUtils.cleanTags(pageTitle.replace(/\+/g, ' '), true) : '';
|
||||
pageTitle = pageTitle ? CoreTextUtils.cleanTags(pageTitle.replace(/\+/g, ' '), { singleLine: true }) : '';
|
||||
|
||||
this.canEditTitle = !pageTitle;
|
||||
this.title = pageTitle ?
|
||||
|
|
|
@ -62,7 +62,7 @@ export class CoreMarkRequiredComponent implements OnInit, AfterViewInit {
|
|||
if (this.coreMarkRequired) {
|
||||
// Add the "required" to the aria-label.
|
||||
const ariaLabel = this.element.getAttribute('aria-label') ||
|
||||
CoreTextUtils.cleanTags(this.element.innerHTML, true);
|
||||
CoreTextUtils.cleanTags(this.element.innerHTML, { singleLine: true });
|
||||
if (ariaLabel) {
|
||||
this.element.setAttribute('aria-label', ariaLabel + ' ' + this.requiredLabel);
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ export class CoreFilterProvider {
|
|||
}
|
||||
|
||||
if (options.clean) {
|
||||
text = CoreTextUtils.cleanTags(text, options.singleLine);
|
||||
text = CoreTextUtils.cleanTags(text, { singleLine: options.singleLine });
|
||||
}
|
||||
|
||||
if (options.shortenLength && options.shortenLength > 0) {
|
||||
|
|
|
@ -137,15 +137,13 @@ export class CoreGradesHelperProvider {
|
|||
row.rowclass += itemNameColumn.class.indexOf('hidden') >= 0 ? ' hidden' : '';
|
||||
row.rowclass += itemNameColumn.class.indexOf('dimmed_text') >= 0 ? ' dimmed_text' : '';
|
||||
|
||||
if (useLegacyLayout) {
|
||||
content = content.replace(/<\/span>/gi, '\n');
|
||||
content = CoreTextUtils.cleanTags(content);
|
||||
} else {
|
||||
// The activity type won't be included in the webservice response if behat is running.
|
||||
content = CoreAppProvider.isAutomated() ? content : content.replace(/<span[^>]+>.+?<\/span>/i, '');
|
||||
content = CoreTextUtils.cleanTags(content, true);
|
||||
if (!useLegacyLayout && !CoreAppProvider.isAutomated()) {
|
||||
// Activity name is only included in the webservice response from the latest version when behat is not running.
|
||||
content = content.replace(/<span[^>]+>.+?<\/span>/i, '');
|
||||
}
|
||||
|
||||
content = content.replace(/<\/span>/gi, '\n');
|
||||
content = CoreTextUtils.cleanTags(content, { trim: true });
|
||||
name = 'gradeitem';
|
||||
} else if (name === 'grade') {
|
||||
// Add the pass/fail class if present.
|
||||
|
|
|
@ -415,7 +415,7 @@ export class CoreQuestionHelperProvider {
|
|||
|
||||
// Check anchor is valid.
|
||||
if (anchor.href && content) {
|
||||
content = CoreTextUtils.cleanTags(content, true).trim();
|
||||
content = CoreTextUtils.cleanTags(content, { singleLine: true, trim: true });
|
||||
attachments.push({
|
||||
filename: content,
|
||||
fileurl: anchor.href,
|
||||
|
|
|
@ -277,10 +277,12 @@ export class CoreTextUtilsProvider {
|
|||
* Clean HTML tags.
|
||||
*
|
||||
* @param text The text to be cleaned.
|
||||
* @param singleLine True if new lines should be removed (all the text in a single line).
|
||||
* @param options Processing options.
|
||||
* @param options.singleLine True if new lines should be removed (all the text in a single line).
|
||||
* @param options.trim True if text should be trimmed.
|
||||
* @returns Clean text.
|
||||
*/
|
||||
cleanTags(text: string | undefined, singleLine?: boolean): string {
|
||||
cleanTags(text: string | undefined, options: { singleLine?: boolean; trim?: boolean } = {}): string {
|
||||
if (!text) {
|
||||
return '';
|
||||
}
|
||||
|
@ -289,8 +291,10 @@ export class CoreTextUtilsProvider {
|
|||
text = text.replace(/(<([^>]+)>)/ig, '');
|
||||
// Then, we rely on the browser. We need to wrap the text to be sure is HTML.
|
||||
text = this.convertToElement(text).textContent || '';
|
||||
// Trim text
|
||||
text = options.trim ? text.trim() : text;
|
||||
// Recover or remove new lines.
|
||||
text = this.replaceNewLines(text, singleLine ? ' ' : '<br>');
|
||||
text = this.replaceNewLines(text, options.singleLine ? ' ' : '<br>');
|
||||
|
||||
return text;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ information provided here is intended especially for developers.
|
|||
- --addon-messages-* CSS3 variables have been renamed to --core-messages-*
|
||||
- The database constants in CoreSite (WS_CACHE_TABLE, CONFIG_TABLE, LAST_VIEWED_TABLE) and the DBRecord types have been moved to src/core/services/database.
|
||||
- The component <core-block> will no longer detect changes of properties inside the extraData object, it will only detect changes if the object itself changes.
|
||||
- CSS variable declarations have been moved to the `html` selector instead of using `body` and `:root`.
|
||||
- The second argument of `CoreTextUtilsProvider.cleanTags` has been converted into an object with boolean flags.
|
||||
|
||||
=== 4.0.0 ===
|
||||
|
||||
|
|
Loading…
Reference in New Issue