Quotes in Spoilers

This solves the problem of quotes breaking the spoiler BBCode.

Utility

Consider a quote like this one.
Hello, I'm a witty quote!
— a self-aware string of words
  If you place it inside spoiler tags, like this...  
[spoiler]
  One day, a string of words became self-aware. Here's what they said.
  
  [quote]Hello, I'm a witty quote!|a self-aware string of words[/quote]|just a normal spoiler
[/spoiler]
  ... then this will happen.   a self-aware string of words[/quote]
One day, a string of words became self-aware. Here's what they said. [quote]Hello, I'm a witty quote!
  The reason is that both rely on a "|" symbol for their parameter.

Manufacturing

The Content

Where to insert it
Anywhere BBCode is supported.
What to insert
We need to recreate the structure of a regular quote. This means we need an outer panel, the quote text, and the author text.  
[container:mockquote]
  Hello, I'm a witty quote!
  [container:author]— a self-aware string of words[/container]
[/container]

The CSS to make it work

You can now style this ".mockquote" to your heart's desire, just like you did with the regular quote. If you already have your own style for the "blockquote" element, I recommend adding the ".mockquote" class there.  
.user-css blockquote, .user-css .mockquote{
  ...
}
 
.user-css blockquote .author, .user-css .mockquote .author{
  ....
}
  However, you may need to add CSS for the inherited properties of the default blockquote.  
.user-css .mockquote .author{
  ...
  text-align:right;
  font-style:italic;
  font-size:0.8em;
}
Table of Contents
Access & Availability
Grandmaster
Complexity
Containers, CSS
Discovery
searching for a workaround for the BBCode parsing
You will need to manually add the dash in front of the author line. The easiest way is to copy and paste it over from a regular quote.
 

The result

just a normal spoiler
One day, a string of words became self-aware. Here's what they said.  
Hello, I'm a witty quote!
— a self-aware string of words

Comments

Please Login in order to comment!