@@ -398,7 +398,6 @@ function regenChatBlock(uuid, div) {
398
398
nextChild . remove ( ) ;
399
399
nextChild = div . nextElementSibling ;
400
400
}
401
- div . previousElementSibling . remove ( ) ;
402
401
div . remove ( ) ;
403
402
404
403
handleOutput ( "/api/regen_block" , { uuid : uuid } ) ;
@@ -794,6 +793,7 @@ function processStream(stream) {
794
793
// console.log("Received chunk:", decoder.decode(value));
795
794
if ( done ) {
796
795
// console.log("Stream complete");
796
+ formatter . updateFormatting ( ) ;
797
797
$ ( "#user-input" ) . prop ( "disabled" , false ) ;
798
798
$ ( "#user-input" ) . attr ( 'placeholder' , 'Type here...' ) ;
799
799
return ;
@@ -828,7 +828,7 @@ var formatter = new (function()
828
828
Object . defineProperty ( this , 'useItalic' , { get ( ) { return ; } } ) ;
829
829
Object . defineProperty ( this , 'useBold' , { get ( ) { return useBoldToggle . prop ( 'checked' ) ; } } ) ;
830
830
831
- let updateTagSearcher = this . updateTagSearcher = function ( )
831
+ this . updateTagSearcher = function ( )
832
832
{
833
833
if ( ! useItalicToggle . prop ( 'checked' ) )
834
834
delete tagSearcher [ 'i' ] ;
@@ -839,18 +839,18 @@ var formatter = new (function()
839
839
else
840
840
tagSearcher [ 'b' ] = / ( \\ ? \* ) { 2 } / ;
841
841
}
842
- let updateFormatting = function ( )
842
+ this . updateFormatting = function ( )
843
843
{
844
- updateTagSearcher ( ) ;
844
+ this . updateTagSearcher ( ) ;
845
845
$ ( '#chatbox .text' ) . each ( function ( )
846
846
{
847
847
let node = $ ( this ) ;
848
848
node . text ( ' ' ) ;
849
849
appendWithLineBreaks ( this . lastChild , this . parentNode . dataset . text ) ;
850
850
} ) ;
851
851
}
852
- useItalicToggle . on ( 'change' , updateFormatting ) ;
853
- useBoldToggle . on ( 'change' , updateFormatting ) ;
852
+ useItalicToggle . on ( 'change' , this . updateFormatting ) ;
853
+ useBoldToggle . on ( 'change' , this . updateFormatting ) ;
854
854
} ) ( ) ;
855
855
856
856
function appendWithLineBreaks ( currentNode , text )
0 commit comments