Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ let processCounter = 0;
* @return {Object} PostHTML tree
*/
function processTree(options) {
const filledSlots = {};

return (tree, messages) => {
log(`Processing tree number ${processCounter}..`, 'processTree');

Expand All @@ -176,6 +174,8 @@ function processTree(options) {
}

match.call(tree, options.matcher, currentNode => {
const filledSlots = {};

log(`Match found for tag "${currentNode.tag}"..`, 'processTree');

if (!currentNode.attrs) {
Expand Down Expand Up @@ -229,14 +229,14 @@ function processTree(options) {
return currentNode.content || nextNode.content;
});

// Process <slot> tags
processSlotContent(nextNode, filledSlots, options);

nextNode = processTree(options)(nextNode, messages);

// Process <fill> tags
processFillContent(nextNode, filledSlots, options);

// Process <slot> tags
processSlotContent(nextNode, filledSlots, options);

// Remove component tag and replace content with <yield>
currentNode.tag = false;
currentNode.content = content;
Expand Down