Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: New and improved tag parser in TXP 4.0.7 (?)
Just a thought but when this does get introduced it will need to made plain that attribute integer values will also need quotes. Up ‘till now things like limit=-999 or link=1 have worked but now they will also require quotes so limit=“999” or link=“1”.
In fact it might pay people to start looking through their code now even if they don’t use SVN. ;)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: New and improved tag parser in TXP 4.0.7 (?)
Those unquoted attribute values still work with the new parser. They’ve just been deprecated, causing warnings in testing/debug mode. In Live mode the warnings don’t show. That makes it easy for people to fix this stuff once they’re running version 4.0.7, to avoid problems in future versions.
Offline
Re: New and improved tag parser in TXP 4.0.7 (?)
That looks great and will simplify things a great deal! thumbs up and thanks!
TXP Builders – finely-crafted code, design and txp
Offline
#16 2008-04-21 06:21:16
- saccade
- Plugin Author
- From: Neubeuern, Germany
- Registered: 2004-11-05
- Posts: 521
Re: New and improved tag parser in TXP 4.0.7 (?)
That is great!
I’ve always had scenarios where tag nesting would have helped very much. I will test it soon. Seems, that I’ll have to untinker some workarounds.
Thanks!
Last edited by saccade (2008-04-21 06:21:39)
Offline
Re: New and improved tag parser in TXP 4.0.7 (?)
oh, yum yum, wondertag support!
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
#18 2008-04-23 15:12:29
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: New and improved tag parser in TXP 4.0.7 (?)
Wow, I wouldn’t have expected this big a change outside of Crockery. Nice to see the main branch getting a little more adventurous. :-)
I’ve made pretty regular use of asy_wondertag, and one site I’ve done relies on it heavily. Having this built in will be a big improvement. Dumb question for Ruud: I assume nesting beyond one level will require the kind of escaping described in your first post, right?
I know you probably hate questions like this, but can you give us any idea when 4.0.7 might be released? I’d like to give my clients a heads-up about the coming changes.
Edit: One more question. I’ve hacked around the lack of support for nested conditions by including the second-level conditional tags in a form, then using txp:output_form
. Is there any reason this wouldn’t still work with the new parser?
Last edited by Logoleptic (2008-04-23 15:37:00)
Offline
Re: New and improved tag parser in TXP 4.0.7 (?)
Yes. Parsing of attribute values works up to unlimited depth, if you escape the quotes properly. In this example, there are NO double quotes, just single quotes:
<txp:tag level1='<txp:tag1 level2=''<txp:tag2 />'' />' />
Adam, can you provide an example where you need multi-level attribute value parsing?
The fact that it works was really a side-effect of the way the parser is built and I couldn’t think of a good real-world example where this would be useful myself :)
Nested tags should now always work even if you’re nesting the same tag over and over again (see example in opening post). In fact, fixing the nesting problems in the old parser was the main reason for me to work on the new parser.
There’s no planned release date for 4.0.7 yet. Nothing wrong with asking the question, but I can’t give a more accurate answer than I’ve already given: unless there’s an urgent need (read: security) to release, don’t expect an update in the next month or so. Looking at the 4.0.x releases, we seem to be having releases about every 6 months.
Last edited by ruud (2008-04-23 16:53:12)
Offline
#20 2008-04-23 19:12:06
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: New and improved tag parser in TXP 4.0.7 (?)
Thanks for the quick follow-up, Ruud.
ruud wrote:
Adam, can you provide an example where you need multi-level attribute value parsing?
The fact that it works was really a side-effect of the way the parser is built and I couldn’t think of a good real-world example where this would be useful myself :)
I can’t think of a use for it offhand, but if it makes it into the final release I’m sure I’ll find something to do with it. :-)
Offline
#21 2008-06-02 03:58:17
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: New and improved tag parser in TXP 4.0.7 (?)
I’m curious why attribute parsing is done only on single-quoted attributes rather than only on double-quoted attributes. I’ve grown accustomed to doing it the other way around in PHP.
Is this because double-quoted is the more common practice for template authors, and you didn’t want to slow down parsing for everyone by making double quotes the choice for parsed attributes?
Offline
Re: New and improved tag parser in TXP 4.0.7 (?)
Yes, that’s the reason.
Offline