My new text markup language
(with-bbcode bbcode
(b (i (o (I AM AN EXPERT PROGRAMMER)))) (sup NO (sup MORE (sup NESTING (sub PROBLEMS))))
bbcode)
The implementation is roughly 5 lines.
Name:
Anonymous2009-10-01 12:22
you forgot the !!.
Name:
Anonymous2009-10-01 12:23
You're language looks like shit.
Name:
Anonymous2009-10-01 12:32
this is not suitably terse for an expert programmer like me. I propose something more like:
hello ^B^bold on^b^off. lol hy 2^^2 = 4
^BIU^LOL HY^biu^
Name:
Anonymous2009-10-01 13:01
Also, the parser in Haskell is 30 lines.
Which means the parser is what, 5 lines in a real language like Perl?
Name:
Anonymous2009-10-01 13:14
>>6
U MENA JAVA? In all seriousness, Perl ∉ Real Languages
Name:
Anonymous2009-10-01 13:20
>>5
Doesn't work with tags with names longer than 1 char. >>7 Neither does Haskell.
Name:
Anonymous2009-10-01 14:34
>>8
Neither does anything else than Scheme and BBCode.
>>17
Should automagically pop the whole stack at the end of the post to avoid BBCode failures when one writes one pop too few.
Name:
Anonymous2009-10-02 16:01
>>22
well surely the bbcode runtime instance would end after each post and free resources and close tags
Name:
Anonymous2009-10-02 17:53
>>18
I know, and I'm advanced in BBCode enough to avoid them.
Still, the closing tags have a big size overhead (especially with [spoiler] tags), and a mistake I sometimes make is accidentally putting the /before the tag instead of inside it.
>>24
Also, the source for my post: I know, and I'm advanced in `b`i`u`o(BBCode) enough to avoid them.
Still, closing tags have a big `b[size overhead] (especially with `code{[spoiler]} tags), and a mistake I sometimes make is accidentally putting the `m{/} `b<before> the tag instead of `i^inside$ it`m(.)
Name:
Anonymous2009-10-02 17:58
>>25
And now you should opensource your implementation...
Name:
Anonymous2009-10-02 19:19
My new text markup language
THIS IS MOTHERFUCKING BOLD MOTHERFUCKER AND THIS MOTHER FUCKER HERE IS ITALIC THIS OH HEY HERE'S AN OVERLINE WAIT THE UNDERLINE COMES NOW I AM AN EXPERT PROGRAMMER THIS IS MOTHERFUCKING BOLD MOTHERFUCKER AND THIS MOTHER FUCKER HERE IS ITALIC !! CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG
DID YOU SAY ``SUP'', BITCH?? NO DID YOU SAY ``SUP'', BITCH?? MORE DID YOU SAY ``SUP'', BITCH?? NESTING DID YOU SAY ``SUP'', BITCH?? PROBLEMS DID YOU SAY ``SUP'', BITCH?? ALRIGHT CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG CLOSE MFING TAG
Name:
Anonymous2009-10-02 21:15
I think a markup language that uses different brackets for different tags would work well.
So there are 4 kinds of matching brackets
[]
{}
<>
()
So it would look like this
[Bold{and italic}text]
Of course the only down side is the number of tags you can use. A possible workaround could be doubling the tags like so.
[[Bold[{and italic}]text]]
That will give us 16 tags to use, 20 if we keep single tags.
class bbcode {
public static function sub($str="") { echo "<sup>".$str."</sup>"; }
public static function sup($str="") { echo "<sub>".$str."</sub>"; }
public static function b($str="") { echo "<b>".$str."</b>"; }
public static function i($str="") { echo "<i>".$str."</i>"; }
public static function o($str="") { echo "<o>".$str."</o>"; }
public static function u($str="") { echo "<u>".$str."</u>"; }
}