The hash (#) sign can't be used as it is replaced by a line break

Bug #179621 reported by Siegfried Gevatter on 2007-12-31
6
Affects Status Importance Assigned to Milestone
Freevial (Game)
Low
Unassigned

Bug Description

Currently the "#" sign can't be used neither in questions nor answers, as it's replaced by a line break. (This is the reason that for example "C#" appears as just "C", a problem that was found during Gresca Gutsy).

As Freevial now handles line breaks by itself, the usage of the hash (#) sign for line breaks should be removed in the next version, and something new should replace it for those few situations where it is useful (providing a way to escape it).

Siegfried Gevatter (rainct) wrote :

Carles, do you have any proposal? «BR» and «\BR» (to escape it), for example?

Changed in freevial:
importance: Undecided → Low
status: New → Triaged
status: Triaged → Confirmed

It should be better to use a single caracter like |.

Happy new year

    Carles Oriol

El dl 31 de 12 del 2007 a les 22:23 +0000, en/na Siegfried Gevatter
(RainCT) va escriure:

> Carles, do you have any proposal? «BR» and «\BR» (to escape it), for
> example?
>

Siegfried Gevatter (rainct) wrote :

I don't agree at all, there's more probability that a single character needs to be used unescaped than a combination of two.

Happy new years! :)

Siegfried Gevatter (rainct) wrote :

s/years/year

Siegfried Gevatter (rainct) wrote :

What's about using '\n' (written) for this?

xdrudis (xdrudis) wrote :

I would use <br/>. XML has its own rules for content, and using it is easier than reinventing
a syntax layer on top of it. If you want to use #, | or \n then you can't ask about unix pipes, C# or
linebreaks in C or many languages
and you'll find some such use case for any single character. Then you'll have to resort to a
escape character that you'll have to escape when you want it to represent itself... (like
# means new line, \# means # and \\ means \ or whatever) and in
the end it won't be less complex than just <br/>. With <br/> the code just has to ask
for a list of text chidren of question, answer or comment and you get text already broken
in lines (one text node one line), and you just ignore br children.
Questions and answers in freevial are so short you don't usualy use line breaks, and when you
do 4 o 5 characters shouldn't be too much. If you don't like br, use <n/> which is slightly
shorter, but I think it's better to copy xhmtl and use <br/>.

I wouldn't use an open and close tag, like <p></p> in html because I think it's too verbose
for the use case. You don't usually have paragraphs in questions or answers, just occasionaly
you may want a line break for some reason.

In comments there's a little more need for line breaks because longer texts fit there (like writing lyrics
of songs or poems, for example) but again most of the time you can do without. And when you need
it <br/> isn't too cumbersome and it's better to use the same everywhere.

I think in XML there're only 3 clean solutions (All are in fact easier to code than the # substitution, and have less pitfalls):
- <br/> It's the one I'd use
- <p></p> Ok, but too verbose
- the current one in the development branch, which is honoring linefeeds in the xml.

In that branch linefeeds in XML text of questions, answers or comments cause lines to be broken
on screen.
This is clean because you won't want a cr or lf in the text to mean something else, so you don't need escapes or anything (you build on the ASCII semantics), it's just a little ugly or uncomfortable when writing the xml because you can't
format it nicely. You have to put text next to tags and keep it in one line unless you mean it
to be broken in lines. If you use <br/> then you can use the convention than whitespace (0x20,0x0a,0x0d) is collapsed in questions (so you can use it to format nicely xml without
effect on the game screen) and <br/> marks newlines,

But these comments are old, I guess it's already been decided...

Siegfried Gevatter (rainct) wrote :

Fixed by xdrudis.

Changed in freevial:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers