Skip to main content
Topic: Mother f#^$king code pasting in editor. (Read 6304 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Mother f#^$king code pasting in editor.

Reply #30
Quote
Ok, next drama: this post is causing a pile of validation errors due to it wanting to insert coloured spans inside all the pre tags:
Yeah I saw that as well ....

I just put things back as pre class=.bbc_code for the code tags since that seems to be the best ATM
Be safe, Be kind, Happy Programing

Re: Mother f#^$king code pasting in editor.

Reply #31
K. Will have to go over it on local and think it through. :)
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Mother f#^$king code pasting in editor.

Reply #32
Lessee now. Wot's it do?

Code: [Select]
			array(
'tag' => 'code',
'type' => 'unparsed_equals_content',
'content' => '<div class="codeheader">' . $txt['code'] . ': ($2) <a href="#" onclick="return smfSelectText(this);" class="codeoperation">' . $txt['code_select'] . '</a></div>' . (isBrowser('gecko') || isBrowser('opera') ? '<pre style="margin: 0; padding: 0;">' : '') . '<code class="bbc_code">$1</code>' . (isBrowser('gecko') || isBrowser('opera') ? '</pre>' : ''),
// @todo Maybe this can be simplified?
'validate' => isset($disabled['code']) ? null : create_function('&$tag, &$data, $disabled', '
global $context;

if (!isset($disabled[\'code\']))
{
$php_parts = preg_split(\'~(&lt;\?php|\?&gt;)~\', $data[0], -1, PREG_SPLIT_DELIM_CAPTURE);

for ($php_i = 0, $php_n = count($php_parts); $php_i < $php_n; $php_i++)

ETA: Firefox seems happy with that. Validates too. Gotta be good.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P