diff --git a/src/js/06-copy-to-clipboard.js b/src/js/06-copy-to-clipboard.js index df86df8..8c9d698 100644 --- a/src/js/06-copy-to-clipboard.js +++ b/src/js/06-copy-to-clipboard.js @@ -6,9 +6,9 @@ var TRAILING_SPACE_RX = / +$/gm var config = (document.getElementById('site-script') || { dataset: {} }).dataset - var uiRootPath = config.uiRootPath == null ? '.' : config.uiRootPath - var svgAs = config.svgAs var supportsCopy = window.navigator.clipboard + var svgAs = config.svgAs + var uiRootPath = (config.uiRootPath == null ? window.uiRootPath : config.uiRootPath) || '.' ;[].slice.call(document.querySelectorAll('.doc pre.highlight, .doc .literalblock pre')).forEach(function (pre) { var code, language, lang, copy, toast, toolbox