Remove accessing legacy RegExp.$ instead of match return value

This commit is contained in:
Maximilian Krög
2022-08-05 00:53:54 +02:00
parent bb3c5bf144
commit 81c10fa609

View File

@@ -364,13 +364,12 @@ exports.publish = function (taffyData, opts, tutorials) {
doclet.examples = doclet.examples.map(function (example) {
let caption, code;
if (
example.match(
/^\s*<caption>([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i
)
) {
caption = RegExp.$1;
code = RegExp.$3;
const match = example.match(
/^\s*<caption>([\s\S]+?)<\/caption>(?:\s*[\n\r])([\s\S]+)$/i
);
if (match) {
caption = match[1];
code = match[2];
}
return {