@@ -23,11 +23,21 @@ import {
2323 QuillEditorComponent ,
2424 ] ,
2525} )
26- export class MarkdownEditorComponent {
26+ export class MarkdownEditorComponent {
2727 /**
2828 * Markdown Editor String value
2929 */
30- @Input ( ) editValue = '' ;
30+ @Input ( ) set editValue ( value : string ) {
31+ if ( value && ! this . _editValue ) {
32+ this . _editValue = value ;
33+ }
34+ }
35+
36+ get editValue ( ) : string {
37+ return this . _editValue ;
38+ }
39+
40+ private _editValue = '' ;
3141 /**
3242 * Indicates whether the markdown editor is required.
3343 */
@@ -43,7 +53,7 @@ export class MarkdownEditorComponent {
4353 */
4454 modules : QuillModules = {
4555 'toolbar' : {
46- container : [
56+ container : [
4757 [ 'bold' , 'italic' , 'underline' , 'strike' ] ,
4858 [ { 'header' : 1 } , { 'header' : 2 } ] ,
4959 [ { 'list' : 'ordered' } , { 'list' : 'bullet' } ] ,
@@ -69,6 +79,7 @@ export class MarkdownEditorComponent {
6979 */
7080 updateContent ( content : ContentChange ) {
7181 const sanitizedContent = this . sanitizer . sanitize ( SecurityContext . HTML , content . html ) ;
72- this . editValueChange . emit ( sanitizedContent ) ;
82+ const normalizedContent = sanitizedContent ?. replace ( / & # 1 6 0 ; / g, ' ' ) ;
83+ this . editValueChange . emit ( normalizedContent ) ;
7384 }
7485}
0 commit comments