Skip to content

Blows chunks when defining a function above an array #133

@PS-davetemplin

Description

@PS-davetemplin

WORKS

JSLT

def remove_html(text)
  replace($text, "</?h3\\s?[^>]*>", "")

{
  "title" : remove_html(.html)
}

INPUT

{"html": "<h3>hello</h3>"}

DOES NOT WORK

JSLT

def remove_html(text)
  replace($text, "</?h3\\s?[^>]*>", "")

[for (.) {
  "title" : remove_html(.html)
}]

INPUT

[{"html": "<h3>hello</h3>"}]

BLOWS CHUNKS...

ERROR: com.schibsted.spt.data.jslt.JsltException: Parse error: Encountered " "for" "for "" at line 4, column 2.
Was expecting one of:
    "null" ...
    <INTEGER> ...
    <DECIMAL> ...
    <STRING> ...
    "[" ...
    ":" ...
    "{" ...
    "true" ...
    "false" ...
    "." ...
    "if" ...
    "(" ...
    <IDENT> ...
    <PIDENT> ...
    <VARIABLE> ...
     at <inline>:4:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions