Skip to content

Commit

Permalink
Updated StoryMetadata to StoryData
Browse files Browse the repository at this point in the history
Fixed issue #1.
  • Loading branch information
Dan Cox authored and Dan Cox committed Jun 16, 2019
1 parent 52c8229 commit 3824f00
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions TweeParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class TweeParser {
tags = [];
}


// Test for position information
let openingLessPosition = header.lastIndexOf('<');
let closingGreaterPosition = header.lastIndexOf('>');
Expand Down Expand Up @@ -201,14 +201,14 @@ class TweeParser {

}

// Look for StoryMetadata
// Look for StoryData
pos = this.passages.find((el) => {
return el.name == "StoryMetadata";
return el.name == "StoryData";
});

if(pos != undefined ) {

// Try to parse the StoryMetadata
// Try to parse the StoryData
try {

this.story.metadata = JSON.parse(pos.text);
Expand All @@ -219,10 +219,10 @@ class TweeParser {

}

// Remove the StoryMetadata passage
this.passages = this.passages.filter(p => p.name !== "StoryMetadata");
// Remove the StoryData passage
this.passages = this.passages.filter(p => p.name !== "StoryData");

}
}

// Set the passages to the internal story
this.story.passages = this.passages;
Expand Down

0 comments on commit 3824f00

Please sign in to comment.