Tags:
archive_me1Add my vote for this tag create new tag
, view all tags

Bug: Attempting to show BNF defs as code fails to render

If you try to use TWiki to specify data using a BNF style definition, the := in the middle is eaten by TWiki's syntax. Given Wiki's are largely a programmer's tool at present - much more so that plain users this is a big deficiency. Working around by using <tt> tags instead is an unacceptable solution - the pattern should be changed to avoid turning accepted normal BNF into gibberish.

Test case

You type:

   * =sourceline := "? itemvalue "? (' ' attributedefinition)*= <br>
      =attributedefinition := attribute = attributevalue= <br>
      =attribute := [a-zA-Z0-9][a-zA-Z_0-9]*= <br>
      =attributevalue := "[^"]+"= <br>
You get:
  • sourceline : "? itemvalue "? (' ' attributedefinition)*=
    attributedefinition : attribute = attributevalue=
    attribute : [a-zA-Z0-9][a-zA-Z_0-9]*=
    attributevalue : "[^"]+"=

You should get:

  • sourceline := "? itemvalue "? (' ' attributedefinition)*
    attributedefinition := attribute = attributevalue
    attribute := [a-zA-Z0-9][a-zA-Z_0-9]*
    attributevalue := "[^"]+"

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: twiki.org
Server OS: twiki.org
Web server: twiki.org
Perl version: twiki.org
Client OS: Any
Web Browser: Any

-- TWikiGuest - 28 Aug 2003

Follow up

This is an esoteric case. If fixed it could have other surprizing side effects. If you want to use BNF you can put it in verbatim tags:

    sourceline := "? itemvalue "? (' ' attributedefinition)* 
    attributedefinition := attribute = attributevalue 
    attribute := [a-zA-Z0-9][a-zA-Z_0-9]* 
    attributevalue := "[^"]+" 

-- PeterThoeny - 28 Sep 2003

Fix record

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2008-09-02 - TWikiJanitor
 
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.