Commit 65a786bf authored by yann300's avatar yann300 Committed by ioedeveloper

Ensure path of content loaded in the editor is consistent

parent 501434e2
...@@ -324,6 +324,13 @@ class Editor extends Plugin { ...@@ -324,6 +324,13 @@ class Editor extends Plugin {
* @param {string} content Content of the document or update. * @param {string} content Content of the document or update.
*/ */
open (path, content) { open (path, content) {
/*
we have the following cases:
- URL prepended with "localhost"
- URL prepended with "browser"
- URL not prepended with the file explorer. We assume (as it is in the whole app, that this is a "browser" URL
*/
if (!path.startsWith('localhost') && !path.startsWith('browser')) path = `browser/${path}`
if (!this.sessions[path]) { if (!this.sessions[path]) {
const session = this._createSession(content, this._getMode(path)) const session = this._createSession(content, this._getMode(path))
this.sessions[path] = session this.sessions[path] = session
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment