Sha256: be1cfdc131e316aaa68fe21291b9d0cdea13f8e9d7c304448e5e44ab6221f669

Contents?: true

Size: 1 KB

Versions: 91

Compression:

Stored size: 1 KB

Contents

'use strict';

(function () {
    var configure, highlightBlock;

    configure = hljs.configure;
    // "extending" hljs.configure method
    hljs.configure = function _configure (options) {
        var size = options.highlightSizeThreshold;

        // added highlightSizeThreshold option to set maximum size
        // of processed string. Set to null if not a number
        hljs.highlightSizeThreshold = size === +size ? size : null;

        configure.call(this, options);
    };

    highlightBlock = hljs.highlightBlock;

    // "extending" hljs.highlightBlock method
    hljs.highlightBlock = function _highlightBlock (el) {
        var innerHTML = el.innerHTML;
        var size = hljs.highlightSizeThreshold;

        // check if highlightSizeThreshold is not set or element innerHTML
        // is less than set option highlightSizeThreshold
        if (size == null || size > innerHTML.length) {
            // proceed with hljs.highlightBlock
            highlightBlock.call(hljs, el);
        }
    };

})();

Version data entries

91 entries across 91 versions & 10 rubygems

Version Path
grape-swagger-rails-0.6.0 app/assets/javascripts/grape_swagger_rails/highlight.9.1.0.pack_extended.js
grape-swagger-rails-0.5.1 app/assets/javascripts/grape_swagger_rails/highlight.9.1.0.pack_extended.js
grape-swagger-rails-0.5.0 app/assets/javascripts/grape_swagger_rails/highlight.9.1.0.pack_extended.js
grape-swagger-rails-0.4.0 app/assets/javascripts/grape_swagger_rails/highlight.9.1.0.pack_extended.js
grape-swagger-rails-0.3.1 app/assets/javascripts/grape_swagger_rails/highlight.9.1.0.pack_extended.js
rest-ftp-daemon-1.1.1 lib/rest-ftp-daemon/static/swagger/lib/highlight.9.1.0.pack_extended.js
rest-ftp-daemon-1.1.0 lib/rest-ftp-daemon/static/swagger/lib/highlight.9.1.0.pack_extended.js
rswag-ui-1.6.0 vendor/assets/components/swagger-ui/lib/highlight.9.1.0.pack_extended.js
rest-ftp-daemon-1.0.15 lib/rest-ftp-daemon/static/swagger/lib/highlight.9.1.0.pack_extended.js
rswag-ui-1.5.2 vendor/assets/components/swagger-ui/lib/highlight.9.1.0.pack_extended.js
rswag-ui-1.5.1 vendor/assets/components/swagger-ui/lib/highlight.9.1.0.pack_extended.js
rswag-ui-1.5.0 vendor/assets/components/swagger-ui/lib/highlight.9.1.0.pack_extended.js
rswag-ui-1.4.0 vendor/assets/components/swagger-ui/lib/highlight.9.1.0.pack_extended.js
rest-ftp-daemon-1.0.14 lib/rest-ftp-daemon/static/swagger/lib/highlight.9.1.0.pack_extended.js
rest-ftp-daemon-1.0.13 lib/rest-ftp-daemon/static/swagger/lib/highlight.9.1.0.pack_extended.js
rest-ftp-daemon-1.0.12 lib/rest-ftp-daemon/static/swagger/lib/highlight.9.1.0.pack_extended.js
openapi-rails-0.4.0 app/assets/javascripts/openapi/lib/highlight.9.1.0.pack_extended.js
rest-ftp-daemon-1.0.11 lib/rest-ftp-daemon/static/swagger/lib/highlight.9.1.0.pack_extended.js
rest-ftp-daemon-1.0.10 lib/rest-ftp-daemon/static/swagger/lib/highlight.9.1.0.pack_extended.js
rswag-ui-1.3.0 vendor/assets/components/swagger-ui/lib/highlight.9.1.0.pack_extended.js