Howdy, Stranger!

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

Problem with tildes in Harlowe Twine 2

Twine 2 & Harlowe.

I want to be able to put punctuation inside macros.

According to the "Verbatim markup" section of the Harlowe manual, if I want to use punctuation within a macro call, I should use tildes (or graves, it's not clear--the text says tildes but the actual mark they use is a grave). However, when I try this, it doesn't work. The output is always "unexpected markup". Can anyone tell me what I'm doing wrong? I've tried so far:
(print: "He said, "Hi." ")
(print: "He said, `"Hi."`")
(print: "He said, ~"Hi."~")
(print: "He said, ``"Hi."``")
(print: "He said, ~~"Hi."~~")

In another example, I can't seem to get question marks to work inside click-append, like so:
Do you want to make a wish? (click-append: "Do you want to make a wish?")[Ask and ye shall receive.]

With this example, the clickable link doesn't appear in the playthrough.

Is this just a known issue and I'll have to work around it? Thanks!

Comments

  • edited May 2016
    ...punctuation inside macros.
    Verbatim markup is used to escape (passage) text, not String data being passed as parameters to a macro.

    note: A Harlowe String is actually a Javascript String, and a String literal can be delimited by either single or double quotes.
    (print: 'this String is delimited by single quotes')
    (print: "this String is delimited by double quotes")
    

    You have two options when you want to include a String delimiter character within a String:

    a. Use the other type of quote to delimiting the String:
    (print: 'He said, "Hi." ')
    
    b. Use a backslash character \ to escape the delimiter character within the String:
    (print: "He said, \"Hi.\" ")
    

    Is this just a known issue and I'll have to work around it?
    It appears that you may of found a parser bug, if so you should create an issue on the Harlowe project website.

    You can use a named hook to achieve what you want:
    |hookname>[Do you want to make a wish?] (click-append: ?hookname)[Ask and ye shall receive.]
    
  • Thanks very much, greyelf! Looks like I'll just have to do some fixes to make it work.
Sign In or Register to comment.