Tags:
create new tag
view all tags

Question

Is there a way to disable wiki processing in specific blocks of text? For example, if I want to copy a packet format from an RFC, and don't want Wiki to interpret it as tables (due to existence of "|"), I can encapsulate it in pre tags. But I want to also apply my own style to the specific pre tag (class="myclass"). Wiki currently renders all text within a pre/verbatim tag if the tag has a class attribute (or any attribute, it seems). Is there a way around this? Ideally I should be able to cordon off a block of my text to be un-rendered, so that my html is displayed as straight HTML (i.e., un-wiki-ized).

This issue appears to only be related to table-shortcuts, at least with my limited exposure to wiki thus far.

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Mandrake 8.0
Web server: Apache 1.3.19
Perl version: 5.6.0
Client OS: Mandrake 10, Win2k, RedHat 9
Web Browser: Firefox
Categories: Missing functionality, Deployment, Skin

-- TWikiGuest - 19 Apr 2005

Answer

You can put a div around the verbatim tags (look at the raw topic text):

Normal table:

Column 1 Column 2
text 1 text 2

Table code in verbatim tags:

%TABLE{}%
| *Column 1* | *Column 2* |
| text 1  | text 2  |

Table code in verbatim tags encapsulated in div with class myclass:

%TABLE{}%
| *Column 1* | *Column 2* |
| text 1  | text 2  |

Table code in verbatim tags encapsulated in div with class myclass2:

%TABLE{}%
| *Column 1* | *Column 2* |
| text 1  | text 2  |

-- ArthurClemens - 19 Apr 2005

I understand, but there's a bit of an issue with this solution, as follows: Let's say your class did not define the behavior for pre tags: .myclass { font-color:blue; }

By default in the pattern-skin, pre text is brown. If I define myclass with text color blue, the text within the pre/verbatim tag is still going to be brown (as it should be). I understand that this is a good workaround, but I should be allowed to define my style for the pre tag. I would think that the wiki engine should be able to process pre tags the same way whether they have attributes or not. Am I misunderstanding something about how the engine's parser works? Seems like it's doing an exact match for <pre> rather than variants of the tag.

Thanks much for the response, BTW

-- TWikiGuest - 19 Apr 2005

So would you like to define your own style for all pre tags, or only custom for <pre> and not for verbatim?

-- ArthurClemens - 19 Apr 2005

I'd rather not do it tag specific. Let's just say I only want to change the font color and background in class "myclass":

.myclass { color: red; background-color: silver; }

I should then be able to use this class in any tag I want to. I know in most cases good CSS will define which tag-types I define my class for, but in this case, given that it's so generic, I should be able to do this. So my pre/verbatim/code/tt stuff will still use the default values from the skin I use (eg. Dragon or Pattern), and the class will override the specific attributes.

Basically I should be able to leave everything as is, just add the above class to USERSTYLEURL, and provide something like the following (i've encapsulated in verbatim tags, but only for pretty display here, so please ignore that in the raw text):

<pre class="myclass">
text with table-type syntax that does not get parsed, but shows up pre-formatted and with myclass applied
</pre>
-- TWikiGuest - 19 Apr 2005

This appears to be a bug. I have filed a bug report in Codev.AllowCssClassesInVerbatimTags.

-- ArthurClemens - 20 Apr 2005

The bug is fixed on the DEVELOP branch, and will be publicly available with the next TWiki release: Codev.DakarRelease.

With the fix, you will be able to write:

<verbatim class="myclass">
or
<verbatim style="color:orange;">

-- ArthurClemens - 20 Apr 2005

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2005-04-20 - ArthurClemens
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.