<p>Replacing BBCodes with regular expressions or simple string replaces is a very bad idea, as it could end in not well-formed HTML/XHTML. In mind of the MVC pattern, this should also be part of a view helper, not of a component in the controller part.</p>
<p>I agree, its a nice one, but its in PHP4 and quite complex to use (it maybe might be easier <ac:emoticon ac:name="wink" />). But this shows me one thing: Its not such a good idea to try to replace BBCode with theire html-tags, as you also mentioned, instead of a "parsing process". So it seems to be more useful to implement BBCode as an own component instead of a filter (also mentioned by another proposal (1)), which cant reach the power of something like Seiler's implementation. A filter may access that component.</p>
<p>I think this needs to be its own component with a view helper. The Zend_Markup approach seems more "correct" in this respect. Perhaps you could work with Pieter Kokx on a joint proposal.</p>
<ac:macro ac:name="note"><ac:parameter ac:name="title">"Zend Official Response"</ac:parameter><ac:rich-text-body>
<p>This proposal is being moved to <strong>Archived</strong> in favor of a the work being done inside Zend_Markup. Ideally, we'd like to see a more common interface for translating from one markup language to another.</p>
5 Comments
comments.show.hideSep 16, 2007
Ben Scholzen
<p>Replacing BBCodes with regular expressions or simple string replaces is a very bad idea, as it could end in not well-formed HTML/XHTML. In mind of the MVC pattern, this should also be part of a view helper, not of a component in the controller part.</p>
Sep 16, 2007
Ben Scholzen
<p>By the way, here you can see a very good implementation of BB-code parsing:</p>
<p><a class="external-link" href="http://www.christian-seiler.de/projekte/php/bbcode/index_en.html">http://www.christian-seiler.de/projekte/php/bbcode/index_en.html</a></p>
Jul 30, 2008
Sebastian Krebs
<p>I agree, its a nice one, but its in PHP4 and quite complex to use (it maybe might be easier <ac:emoticon ac:name="wink" />). But this shows me one thing: Its not such a good idea to try to replace BBCode with theire html-tags, as you also mentioned, instead of a "parsing process". So it seems to be more useful to implement BBCode as an own component instead of a filter (also mentioned by another proposal (1)), which cant reach the power of something like Seiler's implementation. A filter may access that component.</p>
<p>(1) <a class="external-link" href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Filter_Bbcode+-+Pieter+Kokx">http://framework.zend.com/wiki/display/ZFPROP/Zend_Filter_Bbcode+-+Pieter+Kokx</a></p>
Oct 31, 2008
Matthew Ratzloff
<p>I think this needs to be its own component with a view helper. The Zend_Markup approach seems more "correct" in this respect. Perhaps you could work with Pieter Kokx on a joint proposal.</p>
Feb 19, 2009
Ralph Schindler
<ac:macro ac:name="note"><ac:parameter ac:name="title">"Zend Official Response"</ac:parameter><ac:rich-text-body>
<p>This proposal is being moved to <strong>Archived</strong> in favor of a the work being done inside Zend_Markup. Ideally, we'd like to see a more common interface for translating from one markup language to another.</p>
<p>Zend_Markup:
<a class="external-link" href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Markup+-+Pieter+Kokx">http://framework.zend.com/wiki/display/ZFPROP/Zend_Markup+-+Pieter+Kokx</a></p>
</ac:rich-text-body></ac:macro>