ArduboyCollection
ArduboyCollection copied to clipboard
Parse '\n' escape code in descriptions
Several descriptions are using \n but these aren't getting parsed and translated into page breaks.
Rather than removing all the \n and replacing them with spaces, perhaps it would be possible to turn them into page breaks?
Otherwise, replacing them with spaces would make sense.
I think spaces are more adequate. Another option is try to make the multiline quoted item work (http://php.net/manual/en/function.parse-ini-file.php)
I'm not sure how your website handles newlines or page breaks in the description.
If spaces are more adequate then doing $string = str_replace('\n', ' ', $string) would be the easiest solution, though perhaps not the fastest.
To be safe, it might be better to to a regex replace to replace all cases of multiple whitespace with single spaces, which should be something like $string = preg_replace('/(\w+)/', ' ', $string).
Getting multiline quotes working on ini files should probably be a separate issue.
If they aren't working by default then I'd have no clue why they wouldn't be (beyond the possibility of PHP being dependant on either Windows or Unix newlines, i.e. "\n" vs "\r\n").
And after that you might still have to do $string = str_replace("\n", " ", $string) or something similar, as well as go through all existing descriptions and alter them.
It's probably better to look at what descriptions currently look like and change the behaviour based on that.
I only found three games using \n, so an alternative solution would be to replace these and put a notice up saying that \n isn't parsed, but manually handling \n would probably be more future proof