Comparing version 1.11.0 to 1.12.0
@@ -26,2 +26,5 @@ 'use strict'; | ||
// in current module, esi:remove are simply removed | ||
html = handleESIRemove(html); | ||
let i = 0; | ||
@@ -73,2 +76,7 @@ const tags = findESIIncludeTags(html, options); | ||
function handleESIRemove(html) { | ||
const re = /<esi:remove>([\s\S]*?)<\/esi:remove>/gm; | ||
return html.replace(re, ''); | ||
} | ||
function getIncludeContents(tag, options) { | ||
@@ -75,0 +83,0 @@ const src = getDoubleQuotedSrc(tag) || getSingleQuotedSrc(tag) || getUnquotedSrc(tag); |
{ | ||
"name": "nodesi", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"description": "ESI: the good parts in node.js", | ||
@@ -9,3 +9,3 @@ "main": "esi.js", | ||
"test:debug": "mocha --inspect-brk test/*.js", | ||
"coverage": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive --exit", | ||
"coverage": "nyc npm run test", | ||
"perf": "node perf.js" | ||
@@ -25,4 +25,4 @@ }, | ||
"hjs": "0.0.6", | ||
"istanbul": "0.4.5", | ||
"mocha": "5.2.0" | ||
"mocha": "5.2.0", | ||
"nyc": "^14.1.1" | ||
}, | ||
@@ -29,0 +29,0 @@ "keywords": [ |
@@ -29,3 +29,4 @@ [![Build Status](https://travis-ci.org/Schibsted-Tech-Polska/nodesi.svg?branch=master)](https://travis-ci.org/Schibsted-Tech-Polska/nodesi) | ||
* Support for <esi:include> tags | ||
* Support for `<esi:include>` tags | ||
* support for `alt` as fallback URL | ||
* Out of the box Express support | ||
@@ -35,4 +36,17 @@ * Custom logging | ||
...and more, take a look at test cases for complete list. | ||
…and more, take a look at test cases for complete list. | ||
### Advanced ESI features | ||
`nodesi` does not support the entire ESI spec, but aims to provide a usable subset. This includes, of course `<esi:include src="…">`, but also some more advanced features like: | ||
#### Fallback URL with `alt` | ||
```html | ||
<esi:include src="http://example.com/1.html" alt="http://bak.example.com/2.html"/> | ||
``` | ||
Will try to include `http://example.com/1.html` first, and if that fails, fall back to `http://bak.example.com/2.html`. If both requests fail, the standard error handling described below will kick in. | ||
## Installation | ||
@@ -39,0 +53,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54964
17
309
219