Logged Out
Create an Account
Login:
Password:

Forgot your password?
Custom BBC Code Chokes on Line Breaks?

Custom BBC Code Chokes on Line Breaks?
[Back to Index]
Thread Tags
Primary: [Support]
Secondary: None

What I'm attempting to do is add some custom bbc code for blizzard-rep quotes. (e.g. [blizzquote=rep]Quoted Text[/blizzquote]).

Here's what I have for my search string:
/\[blizzquote=(.*?)](.*?)\[\/blizzquote]/i


The replacement html:
<div class="BlizzQuote">
  <span class="BlizzQuoteHeader">$1 wrote:</span>
  <div class="BlizzContent">$2</div>
</div>


The stylesheet:
.BlizzQuote {
  font-size: 8pt;
  font-family: Arial, Helvetica, sans-serif, serif;
  color: #09F;
  border: 2px solid #555555;
  background-color: #333333;
  border-top-right-radius: 15px;
  border-top-left-radius: 15px;
  -moz-border-radius-topright: 15px;
  -moz-border-radius-topleft: 15px;
  -webkit-border-top-right-radius: 15px;
  -webkit-border-top-left-radius: 15px;
  margin-left: 25px;
  margin-right: 25px;
}

.BlizzQuote a:link, .BlizzQuote a:active, .BlizzQuote a:visited {
  color: white;
  text-decoration: none;
}

.BlizzQuote a:hover {
  text-decoration: underline;
}

.BlizzQuoteHeader {
  display: block;
  background-color: transparent;
  background-image: url('http://dkpfiles/chaoticprecision/files/blizz-tiny.gif');
  background-repeat: no-repeat;
  background-position: 5px;
  padding: 4px;
  padding-left: 35px;
  font-weight: bold;
}

.BlizzContent {
  color: #0099FF;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-right: 25px;
  padding-left: 25px;
}


All this works fine when the Quote Text is a single line. As soon as a line break enters the equation, however, I get only plain text - not the formatted html output I'm expecting.

What am I missing?
Add "s" after the "/i" at the end. /s = ignore line breaks.

So, in your case, your regex should be:

/\[blizzquote=(.*?)](.*?)\[\/blizzquote]/si


--
It's all in the reflexes.
lol thank you.. I knew it had to be some little thing I was missing.


[Back to Index]