Subject: Wiki (Textile) parses any XML element starting with "pre" as pre tag.

Original Post Sebastian's Avatar

Sebastian

03 Jul, 2009 12:33 AM

On the wiki, whenever I need to wrap a code sample in a "pre" tag and that code sample then includes an XML element starting with "pre", the wiki textile parser parses this as another "pre" tag. For instance, I have a bunch of XML documents including "prescription" elements and the only way to get formatting right is to replace "prescription" with an accented "prêscription", which is becoming a bit of a hassle.

Any idea on how to fix this?

  1. Support Staff 2 Posted by Tekkub on 03 Jul, 2009 12:45 AM

    Tekkub's Avatar

    Can you give me an example block of code that doesn't work? I thought I'd fixed this issue, this renders correctly on my wiki:

    <pre>
    <pre>
    This is a pre block, [[links]] should not be processed here
    </pre>
    </pre>
    

    pre

  2. 3 Posted by Sebastian Friedrich on 03 Jul, 2009 12:59 AM

    Sebastian Friedrich's Avatar

    It seems it breaks if there are nested tags starting with pre as in this example:

    <?xml version="1.0" encoding="UTF-8"?>
    
      13
      
      1
      8
    
    
  3. 4 Posted by Sebastian Friedrich on 03 Jul, 2009 01:03 AM

    Sebastian Friedrich's Avatar

    Let's see if I can get the source displayed or if that breaks also:

    
    <?xml version="1.0" encoding="UTF-8"?>
    
      13
      
      1
      8
    
    
    
    
    
    
  4. Support Staff 5 Posted by Tekkub on 03 Jul, 2009 01:12 AM

    Tekkub's Avatar

    Ah Tender... luckily the email is plaintext.

  5. 6 Posted by Sebastian Friedrich on 03 Aug, 2009 11:19 PM

    Sebastian Friedrich's Avatar

    Any updates on this?

  6. Support Staff 7 Posted by Tekkub on 11 Aug, 2009 09:08 AM

    Tekkub's Avatar

    No updates at the moment, I've been fighting with the regexp to little success, it seems matching up tags in a regexp is not a simple matter...

  7. 8 Posted by Jakub Narębski on 11 Aug, 2009 03:04 PM

    Jakub Narębski's Avatar

    Why regexp and not parsing?

  8. Support Staff 9 Posted by Tekkub on 12 Aug, 2009 01:16 AM

    Tekkub's Avatar

    Right now we pull the pre blocks out with a regexp before creating the links to other wiki pages, then we inject the pre blocks back in and run the whole shebang through textile. If you've got a nice way to convert [[page name]] into a proper link while avoiding applying it to pre, code and notextile blocks.... I'm all ears!

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

25 Nov, 2009 03:07 AM
25 Nov, 2009 01:41 AM
25 Nov, 2009 01:27 AM
24 Nov, 2009 10:56 PM
24 Nov, 2009 10:54 PM