Using Delphi 10.4, if I create a template that ends with a closing square bracket, GExperts blanks out the template every time and won't accept the information. Adding a space after the ] will work though.
The triple ] will change the internal state from psEnd back to psData which is wrong because then it will not find the end of the CDATA entry until it hits the end of the file or the next CDATA entry.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh great, the bug is fixed in the official repository, but not correctly. It works for 'Cell[|]' but not for other combinations, e.g.
'Cell[|]]a'
encoded as
'<![CDATA[Cell[|]]a]]>'
is read back as
'Cell[|a'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is not a bug but an invalid template: % is the character to enclose parameter strings like %BEGINPARAMLIST%, %PARAMNAME% etc. To add a literal % you need to duplicate it:
Format('',[%%s]);
I'll open a new bug report that there should be some kind of warning when defining such a template.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem seems to be that the text is stored as CDATA in the XML file:
which in itself already contains lots of square brackets, so at the end there is a triple bracket in this case which seems to break the parser.
It does indeed break the parser:
The triple ] will change the internal state from psEnd back to psData which is wrong because then it will not find the end of the CDATA entry until it hits the end of the file or the next CDATA entry.
Oh great, the bug is fixed in the official repository, but not correctly. It works for 'Cell[|]' but not for other combinations, e.g.
'Cell[|]]a'
encoded as
'<![CDATA[Cell[|]]a]]>'
is read back as
'Cell[|a'
fixed in revision #3327
Thanks. Just noticed today that "%s" may be an issue too...
Could you please be more specific? %s should not be a problem at all (at least not with XML parsing).
Just installed the newest version from SourceForge, and this template:
Format('',[%s]);
expands to:
Format('',[Error!
This is not a bug but an invalid template: % is the character to enclose parameter strings like %BEGINPARAMLIST%, %PARAMNAME% etc. To add a literal % you need to duplicate it:
Format('',[%%s]);
I'll open a new bug report that there should be some kind of warning when defining such a template.
Thanks for fixing this!