lolautruche / EmbedTagBundle

eZ Publish 5 bundle providing custom tags for embedding content (YouTube, Vimeo, DailyMotion...)
MIT License
4 stars 5 forks source link

services.yml does not contain valid YAML #4

Closed SalvatorePollaci closed 5 years ago

SalvatorePollaci commented 5 years ago

I'm using version v1.0.2, but I'm not able to clear cache as I get the following error:

In YamlFileLoader.php line 669:

  The file "/var/www/html/project/ezplatform/vendor/lolautruche/embedtag-bundle/DependencyInjection/../Resources/config/services.yml" does not contain valid YAML.

In Unescaper.php line 117:

  Found unknown escape character "\." at line 13 (near "regexp: "#^https?://www\.youtube\.com/watch\?v=(?P<videoId>[^&]+)#"").

It seems that 2 consecutive backslashes should be used to escape rather than one, so services.yml should be:

parameters:
    lolart.embedtag.youtube.default_width: 560
    lolart.embedtag.youtube.default_height: 349
    lolart.embedtag.dailymotion.default_width: 480
    lolart.embedtag.dailymotion.default_height: 270
    lolart.embedtag.vimeo.default_width: 500
    lolart.embedtag.vimeo.default_height: 281
    lolart.embedtag.converter.options:
        youtube:
            default_width: %lolart.embedtag.youtube.default_width%
            default_height: %lolart.embedtag.youtube.default_height%
            embed_pattern: "//www.youtube.com/embed/$$$VIDEO$$$"
            regexp: "#^https?://www\\.youtube\\.com/watch\\?v=(?P<videoId>[^&]+)#"
        dailymotion:
            default_width: %lolart.embedtag.dailymotion.default_width%
            default_height: %lolart.embedtag.dailymotion.default_height%
            embed_pattern: "http://www.dailymotion.com/embed/video/$$$VIDEO$$$"
            regexp: "#^https?://www\\.dailymotion\\.com/video/(?P<videoId>[^_]+)_.+#"
        vimeo:
            default_width: %lolart.embedtag.vimeo.default_width%
            default_height: %lolart.embedtag.vimeo.default_height%
            embed_pattern: "http://player.vimeo.com/video/$$$VIDEO$$$"
            regexp: "#^https?://(www\\.)?vimeo\\.com/(?P<videoId>[^/?]+)#"

    lolart.embedtag.converter.xmltext.video.class: Lolart\Bundle\EmbedTagBundle\Converter\XmlText\VideoPreConverter

services:
    lolart.embedtag.converter.xmltext.video:
        class: %lolart.embedtag.converter.xmltext.video.class%
        arguments: [%lolart.embedtag.converter.options%]
        tags:
            - { name: ezpublish.ezxml.converter }
lolautruche commented 5 years ago

Right, it's been so long I didn't give some love to this package... Sorry about that !

lolautruche commented 5 years ago

See #5 for test