You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (JIRA)" <ji...@apache.org> on 2016/01/07 15:15:41 UTC

[jira] [Assigned] (SLING-5411) Sightly formatting filter only replaces first 10 placeholders

     [ https://issues.apache.org/jira/browse/SLING-5411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Cotescu reassigned SLING-5411:
-----------------------------------

    Assignee: Radu Cotescu

> Sightly formatting filter only replaces first 10 placeholders
> -------------------------------------------------------------
>
>                 Key: SLING-5411
>                 URL: https://issues.apache.org/jira/browse/SLING-5411
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting Sightly Engine 1.0.6
>            Reporter: Vlad Bailescu
>            Assignee: Radu Cotescu
>            Priority: Minor
>             Fix For: Scripting Sightly Engine 1.0.10
>
>
> The Sightly formatting filter only replaces first 10 placeholders.
> For an input of:
> {code}
> ${"1-{0}, 2-{1}, 3-{2}, 4-{3}, 5-{4}, 6-{5}, 7-{6}, 8-{7}, 9-{8}, 10-{9}, 11-{10}, 12-{11}" @ format=[1,2,3,4,5,6,7,8,9,10,11,12]}
> {code}
> the current output is:
> {code}
> 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10, 11-{10}, 12-{11}
> {code}
> This is due to a bad regex pattern at https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/filter/FormatFilter.java#L51, where {{\d}} is used instead of {{\d+}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)