basic Y.Text toJSON returns unformatted string
This avoids text nodes in nested structures returning undefined when toJSON is called by a parent.
This commit is contained in:
@@ -668,6 +668,17 @@ export class YText extends AbstractType {
|
||||
return str
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the unformatted string representation of this YText type.
|
||||
*
|
||||
* Avoids undefined being returned when called as a nested type.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
toJSON () {
|
||||
return this.toString()
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply a {@link Delta} on this shared YText type.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user