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.
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.
- jamesatzephyr
-
Topic Author
- Offline
- Antediluvian
-
Less
More
- Posts: 2788
- Thank you received: 958
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:
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:
Or possibly just changing the "pre" to something else, like "preformat":
Disclaimer: completely untested.
'pre' => array(
'simple_start' => "<pre>",
'simple_end' => "</pre>",
'class' => 'block',
'allow_in' => array('listitem', 'block', 'columns'),
'plain_start' => "<i>",
'plain_end' => "</i>",
),
'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'),
),
...
'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>",
),
'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.
- jamesatzephyr
-
Topic Author
- Offline
- Antediluvian
-
Less
More
- Posts: 2788
- Thank you received: 958
17 Apr 2016 12:39 #76476
by Ankha
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).
Please Log in or Create an account to join the conversation.
Time to create page: 0.107 seconds
- You are here:
-
Home
-
Foro
-
Site & Forum Feedback and News
-
Site & Forum Feedback and News
- PRE tag