Skip to content

Commit

Permalink
Advertising unknown language as such
Browse files Browse the repository at this point in the history
  • Loading branch information
zaratan committed Nov 10, 2020
1 parent 0a14374 commit 0e2ff21
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const parseLang = (str) => {

const attrs = selectors.length ? selectorToAttrs(selectors) : {};
const className = classNames(
lang ? `language-${lang}` : 'language-',
lang ? `language-${lang}` : 'language-unknown',
attrs.class,
);
const { legend = '', ...restAttrs } = attrs;
Expand Down Expand Up @@ -205,7 +205,11 @@ module.exports = (options = {}) => (tree) => {
);
}, '');

const code = h('code', { className: `language-${lang}` }, u('raw', raw));
const code = h(
'code',
{ className: `language-${lang || 'unknown'}` },
u('raw', raw),
);
const pre = h(
'div',
{ className: 'remark-highlight' },
Expand Down

0 comments on commit 0e2ff21

Please sign in to comment.