Remove accessing legacy RegExp.$ instead of match return value
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user