Skip to content

Commit 0e11f47

Browse files
authored
Fix removal of code not in autodetect subset
Closes GH-12. Closes GH-13.
1 parent b8d70d6 commit 0e11f47

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ function attacher(options) {
7777

7878
throw error
7979
}
80-
81-
if (!lang && result.language) {
82-
props.className.push('language-' + result.language)
80+
81+
if (!lang) {
82+
if (result.language) {
83+
props.className.push('language-' + result.language)
84+
} else {
85+
// result.value is empty when highlightjs cant autodetect language
86+
result.value = node.children
87+
}
8388
}
8489

8590
node.children = result.value

0 commit comments

Comments
 (0)