MCPcopy Create free account
hub / github.com/ampproject/amphtml / elementExtractor

Function elementExtractor

build-system/server/app.js:1130–1136  ·  view source on GitHub ↗

* @param {string} tagName * @param {string} type * @return {RegExp}

(tagName, type)

Source from the content-addressed store, hash-verified

1128 * @return {RegExp}
1129 */
1130function elementExtractor(tagName, type) {
1131 type = escapeRegExp(type);
1132 return new RegExp(
1133 `<${tagName}[\\s][^>]*['"]${type}['"][^>]*>([\\s\\S]+?)</${tagName}>`,
1134 'gm'
1135 );
1136}
1137
1138// Data for example: http://localhost:8000/examples/bind/xhr.amp.html
1139app.use('/bind/form/get', (req, res) => {

Callers 1

app.jsFile · 0.85

Calls 1

escapeRegExpFunction · 0.70

Tested by

no test coverage detected