Story of the Four Quotes""""

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
NoQ
Posts: 48
Joined: September 19th, 2012, 6:48 am

Story of the Four Quotes""""

Post by NoQ »

Not sure if crashing the game with invalid WML is considered to be a bug, so not sure what to do, just wanted to report somehow.

First, i figured out that "" is the valid way to insert quote mark into a string.

Code: Select all

[story]
    [part]
        story= _ "And Delfador said: ""Hey, now I know how to insert quotes! That's awesome!"" ..."
    [/part]
[/story]
Then, i figured out that it works at the beginning or at the end of the string as well:

Code: Select all

[story]
    [part]
        story= _ """Yay, I can even quote the whole thing with this!"""
    [/part]
[/story]
That's it for the story so far.
Then, due to annoying auto-completion in my text editor, i made a typo:

Code: Select all

[story]
    [part]
        story= _ """"Gonna try to use more of this now."""
    [/part]
[/story]
And, trying to parse this, the game ran out of memory and got killed by the OOM killer :augh:
Took a while for me to find the typo. Probably a warning message could be useful.
Happened on both 1.10 and 1.11.
The Flight of Drakes, Only Death Behind, ??? (not yet sure how the third part will be called).
User avatar
Iris
Site Administrator
Posts: 6719
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Story of the Four Quotes""""

Post by Iris »

NoQ wrote:And, trying to parse this, the game ran out of memory and got killed by the OOM killer :augh:
Took a while for me to find the typo. Probably a warning message could be useful.
Invalid WML crashing the game is a bug. Invalid WML crashing your machine? Well...

Of course this is a bug, and it would be nice if you could report it in the tracker (per ReportingBugs) with more detailed information and a minimal test case. I appear to be unable to reproduce it on 1.11.15+dev, but that probably just means I’m missing something.

Note that if you need to insert a straight quote in contexts that accept Pango markup like [message] and [part], you should also be able to use " for that purpose:

Code: Select all

[message]
    speaker=narrator
    message=""Yay.""
[/message]
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14.x and 1.15.4+).
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Story of the Four Quotes""""

Post by 8680 »

In English text, typographical quotation marks (U+201C LEFT DOUBLE QUOTATION MARK and U+201D RIGHT DOUBLE QUOTATION MARK) can also be used:

Code: Select all

[message]
    speaker=narrator
    message= _ "“Hurrah.”"
[/message]
These have the comparative advantages of being (a) more legible than " and (b) not part of WML syntax, so they shouldn’t be able to crash the game (and, (c) the proper thing for English text).
Post Reply