@@ -4,23 +4,22 @@ const {match} = require('posthtml/lib/api');
4
4
const { render} = require ( 'posthtml-render' ) ;
5
5
const { each, omit} = require ( 'underscore' ) ;
6
6
7
- const separator = ':' ;
8
-
9
7
/**
10
8
* Set filled slots
11
9
*
12
10
* @param {Object } currentNode PostHTML tree
13
11
* @param {Object } filledSlots
14
- * @param {Object } options Plugin options
12
+ * @param {String } fill Fill tag name
13
+ * @param {String } slotSeparator Slot separator
15
14
* @return {void }
16
15
*/
17
- function setFilledSlots ( currentNode , filledSlots , { fill} ) {
16
+ function setFilledSlots ( currentNode , filledSlots , { fill, slotSeparator } ) {
18
17
match . call ( currentNode , { tag : fill } , fillNode => {
19
18
if ( ! fillNode . attrs ) {
20
19
fillNode . attrs = { } ;
21
20
}
22
21
23
- const name = fillNode . tag . split ( separator ) [ 1 ] ;
22
+ const name = fillNode . tag . split ( slotSeparator ) [ 1 ] ;
24
23
25
24
const locals = omit ( fillNode . attrs , [ name , 'type' , 'append' , 'prepend' , 'aware' ] ) ;
26
25
@@ -51,12 +50,13 @@ function setFilledSlots(currentNode, filledSlots, {fill}) {
51
50
*
52
51
* @param {Object } tree PostHTML tree
53
52
* @param {Object } filledSlots Filled slots content
54
- * @param {Object } options Plugin options
53
+ * @param {String } fill Fill tag name
54
+ * @param {String } slotSeparator Slot separator
55
55
* @return {void }
56
56
*/
57
- function processFillContent ( tree , filledSlots , { fill} ) {
57
+ function processFillContent ( tree , filledSlots , { fill, slotSeparator } ) {
58
58
match . call ( tree , { tag : fill } , fillNode => {
59
- const name = fillNode . tag . split ( separator ) [ 1 ] ;
59
+ const name = fillNode . tag . split ( slotSeparator ) [ 1 ] ;
60
60
61
61
if ( ! filledSlots [ name ] ) {
62
62
filledSlots [ name ] = { } ;
@@ -80,12 +80,13 @@ function processFillContent(tree, filledSlots, {fill}) {
80
80
*
81
81
* @param {Object } tree PostHTML tree
82
82
* @param {Object } filledSlots Filled slots content
83
- * @param {Object } options Plugin options
83
+ * @param {String } slot Slot tag name
84
+ * @param {String } slotSeparator Slot separator
84
85
* @return {void }
85
86
*/
86
- function processSlotContent ( tree , filledSlots , { slot} ) {
87
+ function processSlotContent ( tree , filledSlots , { slot, slotSeparator } ) {
87
88
match . call ( tree , { tag : slot } , slotNode => {
88
- const name = slotNode . tag . split ( separator ) [ 1 ] ;
89
+ const name = slotNode . tag . split ( slotSeparator ) [ 1 ] ;
89
90
90
91
slotNode . tag = false ;
91
92
0 commit comments