performance #1956 added highlightSizeThreshold option disable highlight when length more than highlightSizeThreshold
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
<script src='lib/backbone-min.js' type='text/javascript'></script>
|
||||
<script src='swagger-ui.js' type='text/javascript'></script>
|
||||
<script src='lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
|
||||
<script src='lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
|
||||
<script src='lib/jsoneditor.min.js' type='text/javascript'></script>
|
||||
<script src='lib/marked.js' type='text/javascript'></script>
|
||||
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
|
||||
@@ -38,6 +39,10 @@
|
||||
url = "http://petstore.swagger.io/v2/swagger.json";
|
||||
}
|
||||
|
||||
hljs.configure({
|
||||
highlightSizeThreshold: 5000
|
||||
});
|
||||
|
||||
// Pre load translate...
|
||||
if(window.SwaggerTranslator) {
|
||||
window.SwaggerTranslator.translate();
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
<div class="snippet">
|
||||
{{#if sampleJSON}}
|
||||
<div class="snippet_json">
|
||||
<pre><code class="{{#ifCond sampleJSON.length ">" 5000}}nohighlight{{/ifCond}}">{{sampleJSON}}</code></pre>
|
||||
<pre><code>{{sampleJSON}}</code></pre>
|
||||
{{#if isParam}}<small class="notice" data-sw-translate></small>{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if sampleXML}}
|
||||
<div class="snippet_xml">
|
||||
<pre><code class="{{#ifCond sampleXML.length ">" 5000}}nohighlight{{/ifCond}}">{{sampleXML}}</code></pre>
|
||||
<pre><code>{{sampleXML}}</code></pre>
|
||||
{{#if isParam}}<small class="notice" data-sw-translate></small>{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user