mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[web] avoid accessing the sharejs snapshot directly (#25037)
* [web] avoid accessing the sharejs snapshot directly * [web] limit API interface for sharejs types GitOrigin-RevId: faece372128e4580376e32fa93aa8fedf1e02957
This commit is contained in:
@@ -142,11 +142,8 @@ export class ShareJsDoc extends EventEmitter {
|
||||
|
||||
private removeCarriageReturnCharFromShareJsDoc() {
|
||||
const doc = this._doc
|
||||
if (doc.snapshot.indexOf('\r') === -1) {
|
||||
return
|
||||
}
|
||||
let nextPos
|
||||
while ((nextPos = doc.snapshot.indexOf('\r')) !== -1) {
|
||||
while ((nextPos = doc.getText().indexOf('\r')) !== -1) {
|
||||
debugConsole.log('[ShareJsDoc] remove-carriage-return-char', nextPos)
|
||||
doc.del(nextPos, 1)
|
||||
}
|
||||
@@ -259,7 +256,7 @@ export class ShareJsDoc extends EventEmitter {
|
||||
}
|
||||
|
||||
getSnapshot() {
|
||||
return this._doc.snapshot as string | undefined
|
||||
return this._doc.getText() as string
|
||||
}
|
||||
|
||||
getVersion() {
|
||||
|
||||
Reference in New Issue
Block a user