Skip to main content
Topic: Quote tag (Read 871 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Quote tag

Adding the quote tests I found another edge case:
Code: [Select]
[quote author=]This is a quote[/quote]
that is parsed as:
Code: [Select]
<div class="quoteheader">Quote from: ]This is a quote[/quote</div><blockquote class="bbc_standard_quote"></blockquote>

For the way we do the parsing this is not entirely a bug, probably the intended behaviour[1], but since I'm not entirely sure, what do you think?
This because the author name could start with a ], so the parser is not able to understand what is going on until it reached the closing quote, but at that point I think it's too late to go back and start all over again.
Bugs creator.
Features destroyer.
Template killer.

Re: Quote tag

Reply #1
I mean, honestly, if you are going to try and fix all of these edge-cases crap, get ready to spend the rest of your life on it. Seriously, if you *really* want to break something, you will often find a way to do so, but in "real" applications, those edge cases are not just unlikely, but barely possible at all (who would ever use "]myusername" and similars?).
If you want to fix it, put the author between -->" "<-- these and tell the parser to ignore everything inside of those, just for this edge case.
If you want to be more realistic, say eff it and move on to more important things O:-)
~ SimplePortal Support Team ~

Re: Quote tag

Reply #2
Write test-cases is a way to define the behaviour. Define the behaviour *knowing* why you have defined it like that, is one of the differences between spaghetti code and a well organized code-base.
If at all possible I don't want to end up like our predecessor with code that is there and nobody knows why (not even the author). I would prefer to have a track of the reasons a developer picked a certain decision.
Tests cases are a way to have this tracked.
If the above mentioned is acceptable and can be considered intended, I can add a test reproducing the behaviour, that way we know that we have taken the responsibility to decide that such a case is irrelevant and the problem is acceptable and not just a random unverified behaviour. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Quote tag

Reply #3
Sounds reasonable, I agree. :)

Just got a white page when I clicked post, with an unidentified site icon, too. Check server logs, please. If it has to be a new topic, I'll post it.
~ SimplePortal Support Team ~