gchiu / rebolbot

A stackoverflow chat bot for Rebol
20 stars 6 forks source link

Respect the "fixed font" setting in chat #45

Open hostilefork opened 10 years ago

hostilefork commented 10 years ago

The markup rule for fixed-font text is that you put four spaces in front of all the lines that are in a fixed font.

Currently these spaces lead RebolBot to miss when it is being addressed. So @RebolBot would require some trimming.

In general it's a little weird, because you probably shouldn't trim all the leading spaces... just if you notice the first line is spaced by at least four, then you subtract four from all the lines. This way if you have something like:

@RebolBot print {multi line string, with spaces
        This should be 8 spaces in, not 12 or 0}

You would get:

multi line string, with spaces
        This should be 8 spaces in, not 12 or 0

And not:

multi line string, with spaces
This should be 8 spaces in, not 12 or 0

or:

multi line string, with spaces
            This should be 8 spaces in, not 12 or 0

This is a very important feature to me, because I am currently having to write non-fixed font posts to the bot... wait... and then go back and edit to switch the text.

gchiu commented 10 years ago

Still an issue because if you leave a shifted blank line, rebolbot does nothing

so

>> print 1
print 2

works but

>>
Print 1
print 2 

all in fixed font does not work

hostilefork commented 9 years ago

47 would resolve this issue by not allowing multi-line commands which start with >>