@@ -106,7 +106,7 @@ export class CoreFormatTextDirective implements OnChanges {
106106 * Detect changes on input properties.
107107 */
108108 ngOnChanges ( changes : { [ name : string ] : SimpleChange } ) : void {
109- if ( changes . text ) {
109+ if ( changes . text || changes . filter || changes . contextLevel || changes . contextInstanceId ) {
110110 this . hideShowMore ( ) ;
111111 this . formatAndRenderContents ( ) ;
112112 }
@@ -302,7 +302,7 @@ export class CoreFormatTextDirective implements OnChanges {
302302 return ;
303303 } else {
304304 // Open a new state with the contents.
305- const filter = this . utils . isTrueOrOne ( this . filter ) ;
305+ const filter = typeof this . filter != 'undefined' ? this . utils . isTrueOrOne ( this . filter ) : undefined ;
306306
307307 this . textUtils . expandText ( this . fullTitle || this . translate . instant ( 'core.description' ) , this . text ,
308308 this . component , this . componentId , undefined , filter , this . contextLevel , this . contextInstanceId , this . courseId ) ;
@@ -413,8 +413,8 @@ export class CoreFormatTextDirective implements OnChanges {
413413 this . contextInstanceId = site . getSiteHomeId ( ) ;
414414 }
415415
416- this . filter = typeof this . filter == 'undefined' ?
417- ! ! ( this . contextLevel && typeof this . contextInstanceId != 'undefined' ) : ! ! this . filter ;
416+ const filter = typeof this . filter == 'undefined' ?
417+ ! ! ( this . contextLevel && typeof this . contextInstanceId != 'undefined' ) : this . utils . isTrueOrOne ( this . filter ) ;
418418
419419 result . options = {
420420 clean : this . utils . isTrueOrOne ( this . clean ) ,
@@ -424,7 +424,7 @@ export class CoreFormatTextDirective implements OnChanges {
424424 wsNotFiltered : this . utils . isTrueOrOne ( this . wsNotFiltered )
425425 } ;
426426
427- if ( this . filter ) {
427+ if ( filter ) {
428428 return this . filterHelper . getFiltersAndFormatText ( this . text , this . contextLevel , this . contextInstanceId ,
429429 result . options , result . siteId ) . then ( ( res ) => {
430430
0 commit comments