Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

HTML file output has no , "

I'm using Snowman, and in my output HTML, instead of
<, >, ", '
it has
&lt;, &gt;, &quot;, &#x27;

The only bits that are affected is the text in the passages (the story javascript/stylesheet code is outputted correctly)

I was wondering whether there is a way to make it output a file with the proper characters? I can obviously do a find and replace, but then I have to be careful that I'm not replacing inside strings, etc, which is a bit of a pain.

Comments

  • If this is only happening to the plain-text within your passages then it is known as character escaping and it is a good thing.

    In simple terms certain characters in HTML have special meaning, escaping these characters when they appear in plain-text limits the possibility of them being mistaken for something else.
  • edited July 2015
    If you're referring to the data chunk (within <tw-storydata></tw-storydata>), then that is what you're supposed to see (because you don't want raw HTML active within the data chuck). Published files are not web pages, they are web applications and the data chunk must be encoded (otherwise shenanigans might occur).

    When passages are loaded from the data chunk by the story format's engine, they are decoded, and it's the decoded text that is used. You don't need to do anything for that to happen.

    Passage data is stored within Passage objects, which are stored within the passages property (an array indexed by pid) of the Story object's instance, story. Furthermore, the decoded passage text is stored within a Passage object's source property.


    If you're trying to get at the decoded text of a passage for some reason, then you can simply use the story.passage() method:
    story.passage(/* pid or name goes here */).source
    

    [EDIT]: Whoops, forgot about the story.passage() method. Mea culpa. Thanks to CK, below, for the correction.
  • Just a small addendum that in Snowman, no need to write a custom function. You can write story.passage(3), if for some reason you have a passage's pid, or story.passage('My Passage Name').
  • Thanks!

    I didn't realise that it was converted when run, I just opened the file and thought it was a mistake!
Sign In or Register to comment.