Skip to content

Instantly share code, notes, and snippets.

@brunoais
Created December 8, 2012 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunoais/4241169 to your computer and use it in GitHub Desktop.
Save brunoais/4241169 to your computer and use it in GitHub Desktop.
phpBB BBcode Parser
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div>
<form action="">
<p>
here: first printable character must be the "[" (with the begining of the tag) and the last character must be the "]" with the closing tag.<br>
I try to do the quote tag here, even though it is actually not fully possible. I did 3 possibilities for the input<br>
Pls don't mess with the details, this is just for test and to display an idea, ok ;)?<br>
<textarea cols="130" rows="5">[quote name="{TEXT1}" post="{NUMBER1}" source="{URL1}"]{TEXT2}[/quote]</textarea><br>
<textarea cols="130" rows="10">
<br><blockquote class="uncited"><div>{TEXT2}</div></blockquote>
|
<br><blockquote><div><cite>{TEXT1} wrote:</cite>{TEXT2}</div></blockquote>
|
<br><blockquote><div><cite><a href="{URL1}">{TEXT1}</a> wrote:</cite>{TEXT2}</div></blockquote>
</textarea><br>Here lies the styles that are used for this BBCode.<br>
(These are appened to the rest of the CSS related to the posts. Then all infiled to the proper place)(insipred by Exrection's idea<br>
<textarea cols="130" rows="10">
blockquote {
background: transparent none 6px 8px no-repeat;
border: 1px solid transparent;
font-size: 0.95em;
margin: 0.5em 1px 0 25px;
overflow: hidden;
padding: 5px;
}
blockquote blockquote {
/* Nested quotes */
font-size: 1em;
margin: 0.5em 1px 0 15px;
}
blockquote cite {
/* Username/source of quoter */
font-style: normal;
font-weight: bold;
margin-left: 20px;
display: block;
font-size: 0.9em;
}
blockquote cite cite {
font-size: 1em;
}
blockquote.uncited {
padding-top: 25px;
}
</textarea>
</p>
<p>
<button type="button">validate</button>
</p>
Attribute name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isDefault
<div>
name: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
<input type="radio" name="option" value=""/>
</div>
<div>
post: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
<input type="radio" name="option" value=""/>
</div>
<div>
source: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
<input type="radio" name="option" value=""/>
</div>
<hr>
<div>
None: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<input type="radio" name="option" value=""/>
</div>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment