Skip to content

JS expressions should be encoded as is or omitted? #47

@xcopy

Description

@xcopy

Example:

$options = new Options();
$options->plugins = [
    'tooltip' => [
        'enabled' => true,
        'callbacks' => [
            'label' => "function (context) {...}"
        ]
    ]
];

Expected result:

new Chart(ctx,{
    type: "...",
    data: {
        // ...
    },
    options: {
        // ...
        plugins: {
            tooltip: {
                enabled: true,
                callbacks: {
                    label: function (context) {
                        // ...
                    }
                }
            }
        }
    }
})

Actual result:

new Chart(ctx,{
    type: "...",
    data: {
        // ...
    },
    options: {
        // ...
        plugins: {
            tooltip: {
                enabled: true,
                callbacks: {
                    label: "function (context) {\n
                        // ...
                    \n}"
                }
            }
        }
    }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions