slackhq / csp-html-webpack-plugin

A plugin which, when combined with HTMLWebpackPlugin, adds CSP tags to the HTML output.
MIT License
164 stars 39 forks source link

XHTML mode is not honored #61

Closed sjinks closed 3 years ago

sjinks commented 4 years ago

Description

Currently the plugin does not honor "XHTML mode": for example, if we have a configuration like this:

            new HtmlWebpackPlugin({
                filename: 'index.html',
                template: './src/index.html',
                xhtml: true,
            })

the plugin will still output html-style tags (e.g., <meta charset="utf-8"> instead of <meta charset="utf-8"/>).

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackhq/csp-html-webpack-plugin version: 4.0.0

node version: 12.17.0

OS version(s): any

Steps to reproduce:

See above - create a Webpack config with xhtml: true set for html-webpack-plugin

Expected result:

The generated HTML should have self-closing tags where appropriate, like

<meta charset="utf-8"/>

Actual result:

The generated markup does not honor xhtml: true:

<meta charset="utf-8">
AnujRNair commented 3 years ago

Fixed in https://github.com/slackhq/csp-html-webpack-plugin/pull/75