Skip to content

Commit 443ca51

Browse files
committed
Fix highlight config
1 parent 74bbf22 commit 443ca51

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

dist/scripts/api-console.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
var loc = window.location;
3131
var uri = loc.protocol + '//' + loc.host + loc.pathname.replace(/\/$/, '');
3232

33+
window.hljs.configure({
34+
classPrefix: 'raml-console-hljs-'
35+
});
36+
3337
window.marked.setOptions({
3438
renderer: renderer,
3539
gfm: true,
@@ -42,13 +46,13 @@
4246
highlight: function (code, lang) {
4347
var result = [
4448
'<pre class="raml-console-resource-pre">',
45-
'<code class="raml-console-hljs"',
46-
'<pre>',
47-
'<code class="hljs">',
48-
lang ? window.hljs.highlightAuto(code).value.replace(/hljs/g, 'raml-console-hljs') : code,
49-
'</code>',
50-
'</pre>',
51-
'</code>',
49+
' <code class="raml-console-hljs"',
50+
' <pre>',
51+
' <code class="hljs">',
52+
lang ? window.hljs.highlightAuto(code).value : code,
53+
' </code>',
54+
' </pre>',
55+
' </code>',
5256
'</pre>'
5357
];
5458

src/app/app.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
var loc = window.location;
3131
var uri = loc.protocol + '//' + loc.host + loc.pathname.replace(/\/$/, '');
3232

33+
window.hljs.configure({
34+
classPrefix: 'raml-console-hljs-'
35+
});
36+
3337
window.marked.setOptions({
3438
renderer: renderer,
3539
gfm: true,
@@ -42,13 +46,13 @@
4246
highlight: function (code, lang) {
4347
var result = [
4448
'<pre class="raml-console-resource-pre">',
45-
'<code class="raml-console-hljs"',
46-
'<pre>',
47-
'<code class="hljs">',
48-
lang ? window.hljs.highlightAuto(code).value.replace(/hljs/g, 'raml-console-hljs') : code,
49-
'</code>',
50-
'</pre>',
51-
'</code>',
49+
' <code class="raml-console-hljs"',
50+
' <pre>',
51+
' <code class="hljs">',
52+
lang ? window.hljs.highlightAuto(code).value : code,
53+
' </code>',
54+
' </pre>',
55+
' </code>',
5256
'</pre>'
5357
];
5458

0 commit comments

Comments
 (0)