Hey, Monks all.

I was just thinking that it would be Really Nice, and Not So Hard, I Should Think, if the CB's "talk" button handler (sorry, I don't know the proper Everything-terminology) allowed &lbr; and &rbr; HTML-like escapes for left-braket and right-braket, respectively.

For that matter, they'd be nice in the Monastery in general.

I relise that you can use the &#nn; escapes, but that's a PITA.

Thanks,
James Mastros,
Just Another Perl Scribe

Edited 2002-01-10 by dvergin to fix entities per user request

Replies are listed 'Best First'.
(Ovid) Re: Brackets in the CB.
by Ovid (Cardinal) on Jan 11, 2002 at 06:33 UTC

    theorbtwo wrote: I relise that you can use the &#nn; escapes, but that's a PITA.

    Hmmm... I fail to see how you can use HTML codes to create a middle eastern bread. You could solve the world's hunger problems that way :)

    Seriously, we have so many divergences from actual HTML in our handy little shortcuts that we'll have to start printing a Perl Monks user manual to keep track of 'em all. Wonder if O'Reilly would bite... Sorry, but I'd veto this idea (though I didn't -- it).

    Incidentally, the only reason that I have memorized [ and ] as [ and ] is because of those annoying little brackets. More useless knowledge to impress people with!

    /me notes that the only reason he replied to this node was to slip in that stupid bread joke.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re (tilly) 1: Brackets in the CB.
by tilly (Archbishop) on Jan 11, 2002 at 07:16 UTC
    One of the reasons why I wrote Why I like functional programming was that I was hoping a version of that would be incorporated into the site. The rewrite Functional take 2 was for nate and was intended to solve some specific kinds of problems that the Everything engine faced. (Namely that people should only be using table tags inside of tables that they opened.)

    I don't know whether either was incorporated in the Everything engine, but one of the things that showed up in that thread was the proposed handler:

    sub { my $t_ref = shift; if ($$t_ref =~ /\G([&\[\]<>\\])/g) { return encode_entities($1); } }
    for \, which would allow you to forget all of the special escapes and just backslash any special characters you wanted.

    I think that is a better answer to the problem that you propose, and I still want the feature. Perhaps some day I will be motivated enough to download the Everything engine and do it myself...

      I'm certain that PM's parselinks htmlcode node is much more complicated than the stock Everything's, but methinks it's simply an issue of adding a line or two to the top of it.

      perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

        It is not so simple.

        The suggestion that I had is a replacement that is seen not just for brackets, but also to do things like replace "\&" with "&amp;" so that you can choose to write "\&amp;" and get "&amp;" rather than "\&".

        And that involves the heart of how we parse, rather than just a link here and a couple of disallowed tags there.