diff --git a/core/options.js b/core/options.js index af6994377dd..06886ff6b1d 100644 --- a/core/options.js +++ b/core/options.js @@ -15,6 +15,7 @@ */ goog.module('Blockly.Options'); +const deprecation = goog.require('Blockly.utils.deprecation'); const idGenerator = goog.require('Blockly.utils.idGenerator'); const registry = goog.require('Blockly.registry'); const toolbox = goog.require('Blockly.utils.toolbox'); @@ -105,9 +106,11 @@ class Options { } let pathToMedia = 'https://blockly-demo.appspot.com/static/media/'; if (options['media']) { - pathToMedia = options['media']; + pathToMedia = options['media'].endsWith('/') ? options['media'] : + options['media'] + '/'; } else if (options['path']) { // 'path' is a deprecated option which has been replaced by 'media'. + deprecation.warn('path', 'Nov 2014', 'Jul 2023', 'media'); pathToMedia = options['path'] + 'media/'; } let oneBasedIndex;