I'm writing a script that retrieves the html content of divs from the storage-area based on their tiddler attribute when an internal link is clicked and displays it in a custom div independent of the passages element.
The passage divs in the store area use "\n" to mark line breaks (I assume this has something to do with Twee code). How to I change these to <br /> tags when I get the content so it displays properly? I know it's possible; Twine does it somehow. But, I don't know how, and I haven't been getting anywhere examining the Twine script on the html page source.
I suppose this is just one part of the underlying problem: finding a way to make Tiddly Wiki syntax work with this custom div.
Comments
tale
variable, an instance ofTale
, loads the passage/tiddler data from the store area at initialization. Just get it from there. Once you have thePassage
object, you can access the data you want in a couple ways: Assuming you have a reference to the element you're trying to populate with the passage text, you could simply do this: