嵌套画廊短代码间歇性工作
我有一个展开/折叠插件,可以通过短代码展开/折叠内容。我的可扩展内容是画廊的简码。
请参阅此处:http://shop.dearearth.net/collections
间歇性地,画廊至少出现在第一个要扩展的部分,但从来没有在第二个中...
当然,对此的任何帮助都将非常感激! :)
I have an Expand/ Collapse plugin which, via a shortcode, can expand/ collapse content. My expandable content is a shortcode of a gallery.
See here: http://shop.dearearth.net/collections
INTERMITTENTLY, the gallery shows up in at least the first to be expanded section, but never in the second...
Any help on this would really be appreciated, of course! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道这是否是你的问题,但是短代码“解析代码”严重搞砸了。有各种各样的特殊情况(实际上并没有那么特殊),其中 a) 根本不起作用,或者 b) 所做的事情与您的预期完全不同。
两个示例:
[shortcode][shortcode]
(中间没有空格)将忽略第二个。[shortcode] [shortcode] [/shortcode]
将不会做你想要的事情,即使它在技术上是“正确的”。根本问题是他们“创建”(“偶然发现”可能是更好的描述)一种本质上不可解析的语法。然后......他们试图用正则表达式解析它。这注定会失败——它实际上比尝试使用正则表达式解析 HTML,尽管看起来很困难。
唯一真正的解决方案是摆脱奇怪的遗留语法,然后用实际有效的语法替换当前的“解析器”。开发组邮件列表上的互动没有表明他们意识到自己已经走入了多远的死胡同。
I don't know if this is your problem, but the shortcode "parsing code" is seriously f*cked up. There are all sorts of special cases (which really aren't that special) where it either a) doesn't work at all, or b) does something completely different from what you would expect.
Two examples:
[shortcode][shortcode]
(without a space in between) will ignore the second one.[shortcode] [shortcode] [/shortcode]
will not do what you want, even though it is technically "correct".The fundamental problem is that they have "created" ("stumbled into" might be a better description) a syntax that is inherently un-parsable. And then ... they are trying to parse it with regexp. This is doomed to failure -- it is actually worse than trying to parse HTML with regexp, difficult as that might seem.
The only true solution to this is to get rid of the bizarre legacy syntax and then replace the current "parser" with one that actually works. Interactions on the dev group mailing list show no indication that they realize how far down a dead end they have traveled.