Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
fix(rdmd/codetabs): closes #724
Browse files Browse the repository at this point in the history
  • Loading branch information
rafegoldberg committed Jun 3, 2020
1 parent 58dc35a commit 2a5bbd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/markdown/processor/parse/flavored/code-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ function tokenizer(eat, value) {
val = ['```', val.replace('```', ''), '```'].join('').trim();

// eslint-disable-next-line unicorn/no-unsafe-regex
const [, lang, meta = null, code = ''] = /```([^\s]+)?(?: *([^\n]+))?\s?([^]+)```/gm.exec(val);
const parts = /```([^\s]+)?(?: *([^\n]+))?\s?([^]+)```/gm.exec(val);
const [, lang, , code = ''] = parts;

let meta = parts[2];
meta = typeof meta === 'string' ? meta.trim() : '';

return {
type: 'code',
Expand Down

0 comments on commit 2a5bbd2

Please sign in to comment.