Skip to content

Generating a script tag containing JavaScript code #18

@bicycle1885

Description

@bicycle1885

I tried to generate a script tag that contains a JavaScript code like this:

<script type="text/javascript">
console.log(1);
</script>

However, I couldn't find a way because script doesn't work as I expected when it takes a Dict argument:

julia> using Hiccup

julia> @tags script
script (generic function with 1 method)

julia> script("console.log(1);")
<script>console.log(1);</script>

julia> script("console.log(1);", Dict(:type=>"text/javascript"))
<script type="text/javascript" class="log"></script>

Is this an intended behavior or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions