+1 vote
by (130 points)
I'm using Twine to write text that will be visible to the player. When I use two or more apostrophes in the same passage, Twine mistakenly thinks I'm using single quotes, and the text in between the apostrophes isn't displayed correctly. (For example "I don't know. I haven't tried that. ") We've gone around the problem by adding a \ in front of one of the apostrophes in each passage, but that's only a temporary solution, as the texts can't be shown to the player like that. Is there a patch or other kind of a solution to this problem?

5 Answers

0 votes
by (68.6k points)
edited by

What does isn't displayed correctly mean, specifically?  What's happening?

At a guess, could you be confusing the back quote character with an apostrophe?  The are not the same thing, at all, and the former has specific, syntactical, meaning to Harlowe.

0 votes
by (2.7k points)

May be these links may help

  http://twinery.org/wiki/harlowe:verbatim

and section 'disabling of style characters' of http://twinery.org/wiki/twine2:how_to_format_text 

Did you already try backticks to solve the problem?

0 votes
by (8.6k points)

Caveat: My Twine (Twine 2.1.3, Harlowe 2.0.1) doesn't do that. That said, a few comments:

For quoted text, you should be using the <q>...</q> HTML tags wherever possible. They can be nested, they then make sure your quotes are "balanced", and they automatically create the correct opening/closing quotes when supplied with the correct CSS. For example, this simple CSS gets you the correct English quotes.

q {
	quotes: "“" "”" "‘" "’";
}

Also, you shouldn't be using an apostrophe, you should be using the right single quotation mark in English text. Overall, the line should be written like this:

<q>I don&rsquo;t know. I haven&rsquo;t tried that.</q>

The quote tag goes a bit further than that, you can use it to have different quotes for different languages, or even style the quotes passages differently depending on who's speaking by using custom attributes. For example, if you wish to use Japanese quotes when lang="ja" and the English ones otherwise, it's one extra CSS rule:

q {
	quotes: "“" "”" "‘" "’";
}

q:lang(ja) {
	quotes: '「' '」' '『' '』'
}

And then just add the correct "lang" attribute:

<q>As they say&hellip; <q lang="ja">ありがとう</q>.</q>

Or if you want a whole paragraph to be in a different language:

<p lang="ja"><q>大丈夫ですか?</q></p>

 

0 votes
by (159k points)

You haven't supplied an example of the (your) actual TwineScript that produces the "isn't displayed correctly" result, nor (as mentioned by TheMadExile) have you described exactly what is wrong with the result you got.
Without these two things it is very difficult for us to determine what is causing the result you got, and to supply a solution that will fix it.

I tested the following example in the latest versions of both series of Harlowe (1..x and 2.x), and the generated output appeared correctly.

<u>Using quote characters:</u>\
(set: $message to "\"I don't know. I haven't tried that. \"")\

''embedded in Passage'': "I don't know. I haven't tried that. "
''via variable'': $message
''via print'': (print: "\"I don't know. I haven't tried that. \"")

<u>Using quote HTML:</u>\
(set: $message to "<q>I don't know. I haven't tried that. </q>")\

''embedded in Passage'': <q>I don't know. I haven't tried that. </q>
''via variable'': $message
''via print'': (print: "<q>I don't know. I haven't tried that. </q>")

<u>Using quote HTML and &rsquo;Right-Side-Quote&rsquo; Escape Codes:</u>\
(set: $message to "<q>I don&rsquo;t know. I haven&rsquo;t tried that. </q>")\

''embedded in Passage'': <q>I don&rsquo;t know. I haven&rsquo;t tried that. </q>
''via variable'': $message
''via print'': (print: "<q>I don&rsquo;t know. I haven&rsquo;t tried that. </q>")

 

0 votes
by (810 points)
edited by

I'm curious why you're using two single apostrophes in a row(?), and what outcome you expected besides something that at least looked like a double quotation mark, if not an actual double quotation mark.

Edit:  Never mind; I misunderstood the question.  New question:  Is this line of text with the (separate) apostrophes inside some javascript, or in the main text of the passage?

...