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) { doclet.examples = doclet.examples.map(function (example) {
let caption, code; let caption, code;
if ( const match = example.match(
example.match( /^\s*<caption>([\s\S]+?)<\/caption>(?:\s*[\n\r])([\s\S]+)$/i
/^\s*<caption>([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i );
) if (match) {
) { caption = match[1];
caption = RegExp.$1; code = match[2];
code = RegExp.$3;
} }
return { return {