Skip to content

Commit 6d7d33d

Browse files
authored
Merge pull request #129 from docsbydoxdox/hotfix/code-highlighting
[hotfix] Forced code highlighting to javascript.
2 parents 473aa72 + 7394350 commit 6d7d33d

File tree

1 file changed

+4
-9
lines changed
  • packages/doxdox-renderer-bootstrap/src

1 file changed

+4
-9
lines changed

packages/doxdox-renderer-bootstrap/src/index.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ import { Doc, File, Method } from 'doxdox-core';
99
const md = new MarkdownIt({
1010
html: true,
1111
linkify: true,
12-
highlight: function (str, lang) {
13-
if (lang && hljs.getLanguage(lang)) {
14-
try {
15-
return hljs.highlight(str, { language: lang }).value;
16-
} catch (_) {}
17-
}
18-
19-
return '';
20-
}
12+
highlight: str =>
13+
`<div class="bg-light p-3">${
14+
hljs.highlight(str, { language: 'javascript' }).value
15+
}</div>`
2116
});
2217

2318
const renderMethod = (method: Method) => `<div class="mb-5"><a name="${

0 commit comments

Comments
 (0)