/*
 * Copyright (C) 2016-2020 Kano Computing Ltd.
 * License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
 */
import { PluginReceiver } from './plugin/receiver.js';
export class EditorOrPlayer extends PluginReceiver {
    replaceSource(app) {
        if (app && app.code && app.code.snapshot) {
            if (app.code.snapshot
                && app.code.snapshot.javascript
                && app.code.snapshot.javascript.replace) {
                app.code.snapshot.javascript = app.code.snapshot.javascript.replace(/(&rsquo;)/g, '’');
            }
            if (app.code.snapshot
                && app.code.snapshot.blocks
                && app.code.snapshot.blocks.replace) {
                app.code.snapshot.blocks = app.code.snapshot.blocks.replace(/(&rsquo;)/g, '’');
            }
        }
        if (app && app.source && app.source.replace) {
            app.source = app.source.replace(/(&rsquo;)/g, '’');
        }
        if (app && app.code && app.code.replace) {
            app.code = app.code.replace(/(&rsquo;)/g, '’');
        }
        return app;
    }
}
export default EditorOrPlayer;
//# sourceMappingURL=editor-or-player.js.map