mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-15 16:50:51 +00:00
Merge pull request #2960 from overleaf/jpa-remove-carriage-return-char
[frontend] ShareJsDoc: remove carriage return char from initial snapshot GitOrigin-RevId: c4a2efaa9c1a372bfe7503ab5a55171c7c76b113
This commit is contained in:
parent
42c7fbf38c
commit
bd7bddc2d6
1 changed files with 16 additions and 0 deletions
|
@ -115,6 +115,22 @@ export default (ShareJsDoc = (function() {
|
|||
v: version,
|
||||
snapshot
|
||||
})
|
||||
this._removeCarriageReturnCharFromShareJsDoc()
|
||||
}
|
||||
|
||||
_removeCarriageReturnCharFromShareJsDoc() {
|
||||
const doc = this._doc
|
||||
if (doc.snapshot.indexOf('\r') === -1) {
|
||||
return
|
||||
}
|
||||
window._ide.pushEvent('remove-carriage-return-char', {
|
||||
doc_id: this.doc_id
|
||||
})
|
||||
let nextPos
|
||||
while ((nextPos = doc.snapshot.indexOf('\r')) !== -1) {
|
||||
sl_console.log('[ShareJsDoc] remove-carriage-return-char', nextPos)
|
||||
doc.del(nextPos, 1)
|
||||
}
|
||||
}
|
||||
|
||||
submitOp(...args) {
|
||||
|
|
Loading…
Reference in a new issue