file PRE tag

06 Apr 2016 07:49 - 06 Apr 2016 07:49 #76275 by jamesatzephyr
PRE tag was created by jamesatzephyr
Would it be possible to disable rendering the [ pre ] tag on the forum? It breaks people who are copying card text that includes a Presence level. Example: www.vekn.net/forum/rules-questions/72635-dam-the-heart-s-river-and-catatonic-fear

As far as I know, it worked the right way (for V:TES) on the old forum, so I'm assuming there's a setting somewhere that can be tweaked/modified/overridden.
Last edit: 06 Apr 2016 07:49 by jamesatzephyr. Reason: Changing [pre] ->[ pre ] because it broke this post too... D'oh.

Please Log in or Create an account to join the conversation.

More
10 Apr 2016 10:15 #76337 by Damnans
Replied by Damnans on topic PRE tag
I can't seem to find the way to do it.

If anyone does, please let me know.

:vtes: V:EKN Website Coordinator

:baal: :AUS: :DAI: :FOR: :OBF: :PRE: :MAL: :STR: :flight: :cap11:

Please Log in or Create an account to join the conversation.

More
16 Apr 2016 19:21 #76462 by jamesatzephyr
Replied by jamesatzephyr on topic PRE tag
I don't know what the best way to do this is, but looking at the most recent code on www.kunena.org/ there's a file called "bbcode.php" which maps each of the tags to the corresponding html. There's this:
'pre' => array(
'simple_start' => "<pre>",
'simple_end' => "</pre>",
'class' => 'block',
'allow_in' => array('listitem', 'block', 'columns'),
'plain_start' => "<i>",
'plain_end' => "</i>",
),

Which appears to be the code which controls that [ pre ] goes to <pre>. I suspect that commenting it all out (preceding each line with //) or deleting it would do the trick.

With the current code, it would probably look a bit like:
...
'tt' => array(
'simple_start' => "<tt>",
'simple_end' => "</tt>",
'class' => 'inline',
'allow_in' => array('listitem', 'block', 'columns', 'inline', 'link'),
'plain_start' => "<i>",
'plain_end' => "</i>",
),

// 'pre' => array(
// 'simple_start' => "<pre>",
// 'simple_end' => "</pre>",
// 'class' => 'block',
// 'allow_in' => array('listitem', 'block', 'columns'),
// 'plain_start' => "<i>",
// 'plain_end' => "</i>",
// ),

'font' => array(
'mode' => BBCODE_MODE_LIBRARY,
'allow' => array('_default' => '/^[a-zA-Z0-9._ -]+$/'),
'method' => 'DoFont',
'class' => 'inline',
'allow_in' => array('listitem', 'block', 'columns', 'inline', 'link'),
),
...

Or possibly just changing the "pre" to something else, like "preformat":
'preformat' => array(
'simple_start' => "<pre>",
'simple_end' => "</pre>",
'class' => 'block',
'allow_in' => array('listitem', 'block', 'columns'),
'plain_start' => "<i>",
'plain_end' => "</i>",
),

Disclaimer: completely untested.
The following user(s) said Thank You: Damnans

Please Log in or Create an account to join the conversation.

More
17 Apr 2016 12:39 #76476 by Ankha
Replied by Ankha on topic PRE tag
Thanks. There's probably a little more to do (so that the "pre" button in the editor bar uses the new keyword), but that's one idea. (There's a minor nuisance: the change must be done each time the kunena component is updated).

Prince of Paris, France
Ratings Coordinator, Rules Director

Please Log in or Create an account to join the conversation.

More
Moderators: AnkhaKraus
Time to create page: 0.089 seconds
Powered by Kunena Forum