Skip to content

Commit

Permalink
Revert "refactor(v2): improve regex matching code-block title (facebo…
Browse files Browse the repository at this point in the history
…ok#3671)"

This reverts commit 3242549.
  • Loading branch information
lex111 authored Nov 4, 2020
1 parent 5aca1d7 commit 2e44116
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const highlightDirectiveRegex = (lang) => {
return getHighlightDirectiveRegex();
}
};
const codeBlockTitleRegex = /(?<=title=").*(?=")/;
const codeBlockTitleRegex = /title=".*"/;

export default ({
children,
Expand Down Expand Up @@ -125,7 +125,9 @@ export default ({
// Tested above
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
codeBlockTitle = metastring
.match(codeBlockTitleRegex)![0];
.match(codeBlockTitleRegex)![0]
.split('title=')[1]
.replace(/"+/g, '');
}

let language =
Expand Down

0 comments on commit 2e44116

Please sign in to comment.