mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 11:01:56 +02: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user