Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to modify <code></code> function
Vaz
New
Hi guys,
I'd like to edit the <code> function. Could someone direct me to where I'd find it?
I'd like to edit the function so it adds the following text around the tags:
<dl><dt><a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd>
&
</dd></dl>
So:
<dl><dt><a href="#" onclick="selectCode(this); return false;">Select all</a></dt><dd>
<code>MY TEXT GOES HERE</code>
</dd></dl>
0
This discussion has been closed.
Comments
this
Can I just achieve my goal by making an edit to the css?
$String = preg_replace( array( '/<code((?>[^>]*))>(.+?)<\/code(?>[^>]*)>/sei', '/<(?![A-Za-z\/'.(HTML_ALLOW_COMMENTS?'!':'').'])/i' ), //yet again, order is important array( '\'<code\'.$this->RemoveQuoteSlashes(\'\1\').\'>\'.htmlspecialchars($this->RemoveQuoteSlashes(\'\2\')).\'<./code>\'', '<' ), $String );
Edit what you want in the replacement array. In your case you'd want to change the first element to something like:'\'<dl><dt><a href="#" onclick="selectCode(this); return false;">Select All</a></dt><dd><code\'. $this->RemoveQuoteSlashes(\'\1\').\'>\'.htmlspecialchars($this->RemoveQuoteSlashes(\'\2\')).\'<./code></dd></dl>\'',
(changing <./code> to </code>, obviously)