Description

GetVal macro does not work consistently, omitting entries and adding spurious newlines to parsed data.

Steps to reproduce

  1. Create a dictionary page that defines variables with the definition list syntax.
  2. Use these definitions in another page using the GetVal macro.

  3. Results from parsing are erratic.

Example

Use this markup in a page to define the definitions. For example, put this markup into WikiDict:

#format wiki
Definition list

 variable1:: Testing
 variable2:: This
 variable3:: Feature
 variable4:: Now

Then, try to reference these values on another page (or the same page) with the GetVal macro.

[[GetVal(WikiDict,variable2)]] [[GetVal(WikiDict,variable4)]] [[GetVal(WikiDict,variable3)]] [[GetVal(WikiDict,variable1)]]

On my wiki, the previous markup results in:

This

Now Feature

The parsed data has two anomalies. One, the first definition from the page is often inaccessible, and the GetVal macro results in an empty string. Second, the first GetVal result that is parsed ends up in it's own paragraph instead of being rendered inline as it should.

One instance of this error can be seen in this wiki's WikiDict page. I can be contacted at web@jmack.net for any clarification.

I just (patch340) fixed the problem with variable1. The RE parsing dict and group pages uses \s insted of spaces. \s matches newlines which leads to wrong keys in the dicts.

The second problem (wrong paragraph tags) can't be fixed that easy. Right now macros can't tell the parser wether they need surrounding <p> tags or not. Some important return blockelements and must not be surrounded by <p> tags. The real solution would be to have an method per macro that tell the parser what to do.

Details

MoinMoin Version

1.5beta6

OS and Version

Debian sarge x86

Python Version

2.3.5

Server Setup

Apache 1.3 CGI

Server Details

Workaround

Discussion

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/ErraticGetValMacroExpansion (last edited 2007-10-29 19:10:13 by localhost)