rejetto forum

bug with {{load}}

Mars · 5 · 4582

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
first bug report with LOAD quoted

myfile.txt:
Quote
Where {{set|text|is the good work}}{{^text}}

Edit HTML template:
Quote
{{set |test|{{load dequote | Myfile.txt}}}}
{{^test}}<p>

{{set |test|{{load | Myfile.txt}}}}
{{^test}}<p>

Macros.log
Quote
---
---
   > load dequote | Myfile.txt
   < Where {{set|text|is the good work}}{{^text}}

   > set|text|is the good work
   <

   > ^text
   < is the good work


   > set |test|Where is the good work
   <

   > ^test
   < Where is the good work

   > load | Myfile.txt
   < {{\ Where {{set|text|is the good work}}{{^text}} /}}

   > set |test|{{\ Where {{set|text|is the good work}}{{^text}} /}}
   <

   > ^test
   < {{\ Where {{set


HTML page
Quote
Where is the good work
{{^test}}

SIMILAR BUG WHEN USING ONLY THIS LINE

{{dequote |{{load | Myfile.txt}}}}

HTML result is
{{dequote |{{\ Where {{set|text|is the good work}}{{^text}} /}}}}



« Last Edit: February 11, 2008, 11:39:49 AM by mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
that's a bug in the parser.
i will fix it ASAP.
thank you.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
i found it before you decide to use quoting with LOAD

i had testing a macro QUOTE to see how does hfs and the same bug was here


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
Quote
That method is not enough mars, because you could put this in a file
/}} my macros {{\
and your macros would be executed.
http://www.rejetto.com/forum/index.php?topic=5631.msg1033214#msg1033214

tested with  LOAD  not quoted build 178

{{dequote |{{\   {{length|abcdef}} /}} }} HTML result = 6     

{{dequote |{{\ /}}  {{length|abcdef}} {{\ /}} }} HTML result  = {{dequote |{{\ /}}   6  {{\ /}} }}  but not equal to {{\ /}} 6 {{\ /}}

{{dequote |{{\   {{load|length.txt}}  /}} }}  with  length.txt =  /}}  {{length|abcdef}} {{\
result= {{dequote |{{\   {{load|length.txt}}  /}} }}


{{dequote | {{load|length.txt}}  }}  with  length.txt =  /}}  {{length|abcdef}} {{\
result= {{dequote |{{\   {{load|length.txt}}  /}} }}


Last test
{{dequote |  /}}  {{length|abcdef}} {{\ }} result= {{dequote |  /}}  {{length|abcdef}} {{\ }}

There seems be a problem when a sequence /}} is detected before {{\ or alone.

He must be possible to define a macro such as

{{ set | mymacro | {{\ {{inc|$1}} /}} {{!mytext}} {{\ {{ if |$3 |$4|{{\ {{set |$1|0}} /}} /if}} /}} /set}}

and mymacro stored as  {{inc|$1}} MY TEXT IS HERE {{ if |$3 |$4|{{\ {{set |$1|0}} /}} /if}}

The dequote() function is not rather complex, she has to take into account a management of markers in depth and not only in the extremities of the string which is spent to her in parameter, as works applyMacrosAndSymbols to detect sub-macros
« Last Edit: February 13, 2008, 12:15:57 AM by mars »