@@ -32,10 +32,10 @@ In the example the blocks `title` and `content` will be replaced and
3232the block ` footer ` will remain unchanged:
3333``` js
3434var 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
4040posthtml ([require (' posthtml-extend' )({
4141 encoding: ' utf8' , // Parent template encoding (default: 'utf8')
@@ -64,11 +64,11 @@ The final HTML will be:
6464It's also possible to append and prepend block's content:
6565``` js
6666var 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
7373posthtml ([require (' posthtml-extend' )()]).process (html).then (function (result ) {
7474 console .log (result .html );
0 commit comments