helios-ag / fmbbcodebundle Goto Github PK
View Code? Open in Web Editor NEW:capital_abcd: BBCode bundle for Symfony projects
License: Other
:capital_abcd: BBCode bundle for Symfony projects
License: Other
Hi. When I set something like this:
fm_bbcode:
emoticon:
path: '/path/to/my/emoticons/'
I can run bbcode:dump, and the icons show up on that path. However, when applying my filter (via twig), the src of the img tag will be the default /emoticons/ path, like so:
img src="/emoticons/happy.png" alt=""
Shouldn't the fm_bbcode.emoticon.path be used here?
can you add this feature ?
Hello,
I've tried to parse this BBCode :
[h1]Titototo[/h1]
[h2]Tutu[/h2]
[center][i]Youpi[/i]
[list]
[*]Tralala
[*]Liluolo
[list]
[*]Trululu[/list][/list][/center]
And the XHTML response :
<p></p><h1>Titototo</h1><br>
<h2>Tutu</h2><br>
<div class="align-center"><em>Youpi</em><br>
<ul class="decoda-list"></ul></div><p></p>
The list were not parsed.
When install bundle, we are forced to dump the emoticons, so, to each deployment, I raise.
is it possible to automate this?
thank you
Is there an issue with using code and quote tags, or some kind of special use case?
Same for smilies, i see it in the readme, but its not really documented.
I added it to my white list. But it just spits out the tag as it was put in.
# app/config/config.yml
fm_bbcode:
filter_sets:
forum_post_filter:
locale: en
xhtml: true
filters: [ default ]
whitelist: [ default, b, u, i, list, quote, code, text, url, email, image, video ]
{{ post.getBody | bbcode_filter('forum_post_filter') }}
Input examples.
code
[code]foo[/code]
[CODE]foo[/CODE]
[CODE=C++]#include std:io[/CODE]
quote
[QUOTE=Reece] blah blah blah blah...[/QUOTE]
[QUOTE]foo and bar[/QUOTE]
[quote]foo bar[/quote]
Comes out same as it went in. Bold, Italics and Underline seem to be working just fine though.
Otherwise, if everything works fine, then is there a means to define your own tags and its counter part html?
Hi!
Recently I upgraded Symfony2 to version 2.0.9 and Doctrine2 to version 2.2.0 - and started receiving errors:
An exception has been thrown during the rendering of a template ("Passed array does not specify an existing method (class 'FM\BbCodeBundle\Decoda\Decoda' does not have a method '_loadFile')") in Ser5FooBundle:Div:list.html.twig at line 16.
I tried to change this line
spl_autoload_register(array($this, '_loadFile'));
to
spl_autoload_register(array($this, 'loadFile'));
and everything went fine.
BTW, thanks for a nice bundle =)
Hello,
I tried to use a personalised filter to FMBbCodeBundle, but my Twig Filter don't run with your bundle. And in the doc, there is no documentation to create personalised Filters for this bundle. What can I do ?
After I added this line in post-install-cmd and post-update-cmd :
"FM\BbcodeBundle\Composer\ScriptHandler::installEmoticons"
I get this error :
[ErrorException]
Argument 1 passed to Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::getOptions() must be an instance of Composer\Script\CommandEvent, instance of Composer\Script\Event given, called in ...\vendor\helios-ag\fm-bbcode-bundle\Composer\ScriptHandler.php on line 16 and defined
hello @helios-ag
I have a little problem, I'd like to apply multiple filters on a string like this:
string | bbcode_filter ('emoticons') | bbcode_filter ('layout')
or
string |bbcode_filter(['emoticons', 'layout'])
but string is automatically escaped 2 times
How can I manage this?
Thx
Hello,
I think it could be good to throw an form error to Symfony2 when there is an bbcode syntax error in a form.
Thank you,
remontees
Hello,
I have a new question about your bundle !
I would like to use the bbcode_clean filter directly in a controller, without using any twig view.
I think there is a proper way to call it in a Symfony controller...
I would like to override default emoticons but when I try i get
"The smiley ":)" already exists."
It would be nice to have ability to define our smileys :)
PHP Fatal error: Class 'Decoda\Hook\EmoticonHook' not found in /var/www/Symfony2.1/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Decoda/Hook/EmoticonHook.php on line 28
Fatal error: Class 'Decoda\Hook\EmoticonHook' not found in /var/www/Symfony2.1/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Decoda/Hook/EmoticonHook.php on line 28
Please check: FM\BbcodeBundle\Decoda\DecodaManager.php line 129.
I think there must be: "$code->addHook($extra_hook);".
Thank you.
Hello everyone, I don't know if I'm posting this message in the right place...
But I would like to know how to use the template option in the config.yml file.
For example, I would like to overwrite the video.php template provided by decoda and we have only the ability to add a template file according to the documentation. I think some options are missing.
Any help would be appreciated !
i get a fatal error when pasting some testcode into my base.twig.html
{{'[b]Bold text[/b]'|BBCode}}
Fatal error: Class 'Decoda' not found in C:\Program Files (x86)\Zend\Apache2\htdocs\myproject\vendor\bundles\FM\BbCodeBundle\Twig\Extension\BbCodeHelperExtension.php on line 92
the class Decoda is inside the autoload.php and recognized well using my IDE (Zend Studio/Ecplise PDT).
Currently it is defined on Decoda\Decoda::default()
with these filters and hooks:
public function defaults() {
$this->addFilter(new \Decoda\Filter\DefaultFilter());
$this->addFilter(new \Decoda\Filter\EmailFilter());
$this->addFilter(new \Decoda\Filter\ImageFilter());
$this->addFilter(new \Decoda\Filter\UrlFilter());
$this->addFilter(new \Decoda\Filter\TextFilter());
$this->addFilter(new \Decoda\Filter\BlockFilter());
$this->addFilter(new \Decoda\Filter\VideoFilter());
$this->addFilter(new \Decoda\Filter\CodeFilter());
$this->addFilter(new \Decoda\Filter\QuoteFilter());
$this->addFilter(new \Decoda\Filter\ListFilter());
$this->addHook(new \Decoda\Hook\CensorHook());
$this->addHook(new \Decoda\Hook\ClickableHook());
}
Sets on FM\BbcodeBundle\Decoda\DecodaManager::get()
Probably it's better to add all available filters and hooks.
Hello,
I tried to use that with the filter list
[list]
[*] Element 1
[*] Element 2
[/list]
in Decoda/Hook/EmoticonHook.php, line 56
A Symfony dependency injection container has been found as an argument.
*
* @param LoaderInterface $loader A LoaderInterface instance
* @param mixed $resource The main resource to load
* @param array $options An array of options
*/
public function __construct(LoaderInterface $loader, ContainerInterface $container, array $options = array())
{
$this->loader = $loader;
$this->container = $container;
$this->setOptions($options);
Posted from SensioLabsInsight
Hi,
I would like to see the list of all available BBCodes.Where are they located?
Can anyone tell, I looked for them in the repository but didn't find anything.
Thanks for your help :)
I get the following error message with the new dev-master versions on cache:clear
Fatal error: Can't inherit abstract function Symfony\Component\Config\Loader\LoaderInterface::load()
(previously declared abstract in FM\BbcodeBundle\Translation\Loader\FileLoader)
in /var/www/symfony/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Translation/Loader/FileLoader.php on line 41
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
Any ideas?
custumize
in README.md should be customize
.
Fatal error: Class 'Decoda' not found in /var/www/clients/client1/web16/web/vendor/bundles/FM/BbcodeBundle/Decoda/Decoda.php on line 8
I hate this issue as this error is there since the first release of the FMBbCodeBundle.
I get:
PHP Fatal error: Class 'mjohnson\decoda\Decoda' not found in /Users/ck/Private/proj1/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Decoda/Decoda.php on line 9 Fatal error: Class 'mjohnson\decoda\Decoda' not found in /Users/ck/Private/proj1/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Decoda/Decoda.php on line 9
After installing via composer.
../composer.phar update Loading composer repositories with package information Updating dependencies - Installing mjohnson/decoda (dev-master 62e3161) Cloning 62e316134eeb457c0fafc8cdc6ff0810922732ae - Installing helios-ag/fm-bbcode-bundle (dev-master 4ff68d5) Cloning 4ff68d52796e52cc466dbc01b68531cc8f2f8bb3
Could you add an example how to use emoticons hook ?
Thx !
By default, the locale configuration is set to "ru-ru", i had to set it to "fr-fr" in the configuration to get it working in my language.
First, "xx-xx" is a weird format for a locale.
Second, can't the bundle just use the current SF locale ?
My best workaround for now is :
fm_bbcode:
filter_sets:
forum:
locale: %locale%-%locale%
But i think the bundle should be able to do that automatically.
Hello,
You can see the discussion of the problem here : https://github.com/milesj/php-decoda/issues/24#issuecomment-10697473
Alternative links and abbr aren't working.
Thanks,
remontees
Is it possible that you haven't registered this bundle on http://packagist.org/? Is it possible that you can do it so i can reference it in my composer.json.
When I use master branch on the first page loading (without cache) I get my emoticons with getEmoticonCollection function.
But when I reload the page the function returns an empty array.
I've dumped the emoticons with the command.
And he can't found the image with the url who are generated.
It's always Not Found.
Hello,
I've tried to parse this BBCode :
[h1]Titototo[/h1]
[h2]Tutu[/h2]
[center][i]Youpi[/i]
[list]
[*]Tralala
[*]Liluolo
[list]
[*]Trululu[/list][/list][/center]
And the XHTML response :
<p></p><h1>Titototo</h1><br>
<h2>Tutu</h2><br>
<div class="align-center"><em>Youpi</em><br>
<ul class="decoda-list"></ul></div><p></p>
The list were not parsed.
When running composer update I get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- helios-ag/fm-bbcode-bundle dev-master requires sensio/distribution-bundle ~2.1 -> no matching package found.
- helios-ag/fm-bbcode-bundle dev-master requires sensio/distribution-bundle ~2.1 -> no matching package found.
- helios-ag/fm-bbcode-bundle dev-master requires sensio/distribution-bundle ~2.1 -> no matching package found.
- Installation request for helios-ag/fm-bbcode-bundle dev-master -> satisfiable by helios-ag/fm-bbcode-bundle[dev-master].
This seems to be because the bundle has a hard require on version 2.1 of the distribution bundle and Symfony 2.5 upgraded the distribution bundle to 3.0.
Hello,
I've updated FMBbCodeBundle this afternoon. When I go to a view who use this bundle, I've this error : Fatal error: Class 'mjohnson\decoda\Decoda' not found in /var/www/Symfony/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Decoda/Decoda.php on line 8
What's it ? It's a little bug ?
Thanks,
remontees
It seems that the URL filter requires the bbcode to use quotes to mark it as a URL correctly.
For example:
[url=www.google.com]www.google.com[/url] - does not work
[url="www.google.com"]www.google.com[/url] - works!
Per all bbcode standards I have seen, the url bbcode does not require quotations.
http://www.bbcode.org/examples/?id=9
Is there a way to use the more standard url bbcode syntax or am I doing something wrong?
EDIT: The reason I need this is that I am doing a forum migration from an old platform to symfony and all of the old post use the non-quoted url bbcode.
Thanks!
I would like to show emoticons above textarea
it would be nice to be able to retrieve the list of emoticons contained in emoticons.json file
Is it possible to overload emoticons.json file ?
It is possible to add strict mode in option ?
Thx !
http://milesj.me/code/php/decoda
fm_bbcode:
filter_sets:
my_default_filter:
strict: true/false
xhtml: true
Strict Mode
When strict mode is enabled, all tag attributes will be required to use double quotes. When disabled, attributes with and without wrapping double quotes will be parsed.
$code->setStrict(true);
Procedure given in the help appears to be wrong.
I'm trying to install this bundle but without any success. Case sensitive commands are present.
I cannot success in loading the bundle and their configuration parameters.
Regards.
An exception has been thrown during the rendering of a template ("Warning: file_get_contents(../Resources/config/messages.json): failed to open stream: No such file or directory in /home/toinou/Sites/rencontre/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Decoda/Decoda.php line 49")
fm_bbcode:
filter_sets:
profile:
xhtml: true
strict: false
filters: [default, block, code, email, image, list, quote, text, url, video ]
I have had an exception while trying to add a custom hook method so I can have a separate censored.txt - not one hardcoded from the CONFIG define.
I have the following in config:
fm_bbcode:
config:
hooks:
mensor:
class: WR\CommentBundle\Markup\Censor
classname: Censora
filter_sets:
my_forum_filter:
locale: en
xhtml: true
filters: [ default, quote ]
whitelist: [ b, quote ]
my_comment_filter:
locale: en
xhtml: true
filters: [ default, block, code, list, quote, text, url, link, color ]
hooks: [ Censora ]
I have copied and modified Censor Hook but I get: Catchable Fatal Error: Argument 1 passed to Decoda::addFilter() must be an instance of DecodaFilter, instance of WR\CommentBundle\Markup\Censor given, called in /home/valqk/projects/mysite.com/vendor/bundles/FM/BbcodeBundle/Decoda/DecodaManager.php on line 114 and defined in /home/valqk/projects/mysite.com/vendor/php-decoda/decoda/Decoda.php line 193
after changing line 193 from:
$code->addFilter(new static::$extra_hooks$hook);
to
$code->addHook(new static::$extra_hooks$hook);
it started working.
I suppose it's just a typo but anyway...
Hello,
I have a problem with your bundle. Everything works fine except emoticons.
I added "hooks: [ emoticon ]" in my config and it converts only my smiley if there is only one in the message : http://hpics.li/214be2e
Here is my emoticons.yml :
https://gist.github.com/sebastienvermeille/5d9a2b90dff4844532d7
It is really strange... could you give me an advice if you think this is something I did wrong ? Thank you in advance
when I try to put color like this: [color=#ccc] it does not work
but when I do it [color = "#ccc"] it works.
I use the strict false option
Hi !
I'd use emoticons https://github.com/twitter/twemoji
But sizes do not correspond with the size I want.
I would like to force size to 20px
It's possible to add the ability to give a default size for emoticons?
Thx !
It seems there is an error with the namespace usage:
Fatal error: Class 'FM\BbcodeBundle\Templating\Helper\Decoda' not found in /Users/daniel/Sites/sevenboom/Src/symfony/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Templating/Helper/BbcodeHelper.php on line 32
This should be added:
use FM\BbcodeBundle\Decoda;
use FM\BbcodeBundle\DecodaManager;
Hello,
Why not use the last version 4.2 of PHP Decoda ?
remontees
It would be cool to be able to clean a string containing bbcode
bbcode_filter('filter')
bbcode_clean
Thx
PHP Fatal error: Can't inherit abstract function Symfony\Component\Config\Loader\LoaderInterface::load() (previously declared abstract in FM\BbcodeBundle\Translation\Loader\FileLoader) in /home/stardown/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Translation/Loader/FileLoader.php on line 41
Fatal error: Can't inherit abstract function Symfony\Component\Config\Loader\LoaderInterface::load() (previously declared abstract in FM\BbcodeBundle\Translation\Loader\FileLoader) in /home/stardown/vendor/helios-ag/fm-bbcode-bundle/FM/BbcodeBundle/Translation/Loader/FileLoader.php on line 41
{{ post.text | bbcode_filter('forum') | bbcode_clean | raw }}
It parse bbcode and clear other bbcode I don't want to support yet it returns plain HTML as text
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.