Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

HTML decompiler

Name: Anonymous 2010-04-01 9:42

Hey I need a HTML to BB code decompiler. This is because I'm too lazy to write out my bb code by hand.

Name: Anonymous 2010-04-01 10:03

Hey I need a BB code to HTML decompiler. This is because I'm too lazy to write out my html by hand.

Name: Anonymous 2010-04-01 10:04

Wouldn't all you need to do is replace < and > with [ and ]?

Name: Anonymous 2010-04-01 10:51

Hey I need a "is replace < and >" to "[ and ]" decompiler. This is because I'm write out to too lazy my "[ and ]" by hand.

Name: Anonymous 2010-04-01 11:07

>>4
notepad.exe -> edit -> replace -> find what: < replace with [ -> replace all -> find what: > replace with ] -> replace all

Name: Anonymous 2010-04-01 11:26

Lol enjoy your <spoiler> and <o> tags

Name: Anonymous 2010-04-01 11:43

]]4
<code>notepad.exe -] edit -] replace -] find what: [ replace with < -] replace all -] find what: ] replace with > -] replace all</code>

Name: Anonymous 2010-04-01 11:46

>>6
VALID XML DOCUMENTS

Name: Anonymous 2010-04-01 12:16

>>5
C-M-% <\|> RET \,(if (string= \& "<") "[" "]") RET !

Name: Anonymous 2010-04-01 12:20

tr/<>/[]/g

Name: Anonymous 2010-04-01 12:20

>>9
[b][u][o]EXPERT EMACS HAXING|/o][/u][/b]

Name: Anonymous 2010-04-01 17:51

>>10
y/<>/[]/g

Name: Anonymous 2010-04-01 19:58

use Acme::shiichan::shitchan::HMA::BBCoeds;

Name: Anonymous 2010-04-01 21:36

>>10,12
What the hell is /g?

Name: Anonymous 2010-04-01 21:40

>>14
Replaces more than just the first occurrence.

Name: Anonymous 2010-04-02 5:53

>>14
[cod]g[/code]lobal DUH

Name: Anonymous 2010-04-02 23:20

>>15
Wrong. Lose a turn.

>>16
BBCODE failure. And you lose a turn as well.

Name: Anonymous 2010-04-03 2:46

>>17
[b][i]LOSE MY [spoiler]ANAL VIRGINITY[/i][/b]

Name: Anonymous 2010-04-03 7:15

Here's some shit I wrote two years ago (I ripped out some testing code and hopefully unused functions):

module Language.BBCode (BBCode(..)) where

data BBCode = Element String [BBCode]
            | Text String
  deriving Show


module Language.BBCode.Disassemble (disassembleBBCode) where
import Language.BBCode
import Text.ParserCombinators.Parsec
import Data.List

html = many (try htmlHardBreak <|> try htmlBreak <|> htmlElement <|> htmlText)
htmlText = many1 (noneOf "<") >>= return . Text
htmlHardBreak = (string "<br clear=all>") >> (return (Element "br" []))
htmlBreak = (string "<br/>\n") >> (return (Text "\n"))
htmlElement = do
  (s, as) <- try htmlOpenElement
  content <- html
  htmlCloseElement s
  case lookup "class" as of
    Just c  -> return $ Element c content
    Nothing -> return $ Element s content
htmlOpenElement = do try $ char '<'
                     s <- many1 $ noneOf "/ >"
                     as <- manyTill (space >> spaces >> htmlAttribute) (char '>')
                     return (s, as)
htmlCloseElement s = do try $ string $ "</" ++ s ++ ">"
htmlAttribute = do key <- many1 $ noneOf "="
                   char '='
                   c <- oneOf "\"'"
                   value <- many $ noneOf (if c == '"' then "\"" else "'")
                   char c
                   return (key, value)

eval :: BBCode -> [BBCode]
eval (Element "a" x) = concatMap eval x
eval (Element "quote" x) = Text "> " : concatMap eval x
eval (Element s x) = (Element s (concatMap eval x)) : []
eval (Text x) = (Text (subst "&gt;" ">" x)) : []

subst _ _ [] = []
subst a b ax@(x:xs) = if isPrefixOf a ax
                        then b ++ (subst a b (drop (length a) ax))
                        else x : subst a b xs

disassembleBBCode bb = case parse html "" bb of
                         Left  e  -> error $ show e
                         Right bs -> concatMap eval bs

Name: Anonymous 2010-11-25 5:05

Name: Anonymous 2010-12-17 1:30

Are you GAY?
Are you a NIGGER?
Are you a GAY NIGGER?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!

Name: Anonymous 2013-01-19 23:05

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Don't change these.
Name: Email:
Entire Thread Thread List