Skip to content

Commit 071c4b7

Browse files
authored
Merge pull request #18 from durasj/patch-1
Update README examples with template literals
2 parents cab85f2 + 5927b53 commit 071c4b7

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ In the example the blocks `title` and `content` will be replaced and
3232
the block `footer` will remain unchanged:
3333
```js
3434
var posthtml = require('posthtml');
35-
var html = '<extends src="base.html">' +
36-
'<block name="title">How to use posthtml-extend</block>' +
37-
'<block name="content">Read the documentation</block>'
38-
'</extends>';
35+
var html = `<extends src="base.html">
36+
<block name="title">How to use posthtml-extend</block>
37+
<block name="content">Read the documentation</block>
38+
</extends>`;
3939

4040
posthtml([require('posthtml-extend')({
4141
encoding: 'utf8', // Parent template encoding (default: 'utf8')
@@ -64,11 +64,11 @@ The final HTML will be:
6464
It's also possible to append and prepend block's content:
6565
```js
6666
var posthtml = require('posthtml');
67-
var html = '<extends src="base.html">' +
68-
'<block name="title" type="prepend">How to use posthtml-extend</block>' +
69-
'<block name="content">Read the documentation</block>' +
70-
'<block name="footer" type="append">— 2016</block>'
71-
'</extends>';
67+
var html = `<extends src="base.html">
68+
<block name="title" type="prepend">How to use posthtml-extend</block>
69+
<block name="content">Read the documentation</block>
70+
<block name="footer" type="append">— 2016</block>
71+
</extends>`;
7272

7373
posthtml([require('posthtml-extend')()]).process(html).then(function (result) {
7474
console.log(result.html);

0 commit comments

Comments
 (0)