* @param {posthtml.Node} tree * @return {string}
(tree)
| 26 | * @return {string} |
| 27 | */ |
| 28 | function posthtmlGetAmpFormat(tree) { |
| 29 | let format = defaultFormat; |
| 30 | tree.match({tag: 'html'}, (node) => { |
| 31 | for (const prefix of formatPrefixes) { |
| 32 | for (const suffix of formatSuffixes) { |
| 33 | const attrValue = node.attrs[prefix + suffix]; |
| 34 | if (attrValue === '' || attrValue === true) { |
| 35 | format = 'AMP' + suffix.toUpperCase(); |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | return node; |
| 40 | }); |
| 41 | return format; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Gets the AMP format type for the given HTML file by parsing its contents and |
nothing calls this directly
no outgoing calls
no test coverage detected