Closed matt555 closed 1 year ago
I can confirm the behavior, but rather then doing what you did I believe the change should be to remove the style tags and not use -SkipTags internally, and if user wants to skiptags - go ahead, but be aware of consequences.
This affects output a bit because it creates this:
Instead of singel style with multiple entries, but I guess it's okish. Not sure if I should complicate any further, maybe internally to prevent this from happening, but not sure if it's worth the effort to remove couple of style tags.
I've used
Add-HTMLStyle -Link <link> -Placement <header|footer>
in a number scripts over the years and not sure how i missed that it was never working. Generally the CSS I was adding was overkill so likely not noticeable.Issue
It appears that this was first introduced in commit 1d42199 Where the
<style>
tag is added to anything going to the header or footer.When using
Add-HTMLStyle
to add a CSS link to<head>
or<footer>
the end result looks like this:Example code to reproduce
Note:
-Placement Inline
is not affected by this due to the code here: https://github.com/EvotecIT/PSWriteHTML/blob/master/Public/Add-HTMLStyle.ps1#L87-L93Possible Fix - modify
Private\New-HTMLCustomCSS.ps1
I've modified the
New-HTMLCustomCSS
function with the below code in my$home\Documents\PowerShell\Modules\PSWriteHTML\1.1.0\PSWriteHTML.psm1
and ran various tests. All appear to work without issue.Some noteworthy successful tests are:
Add-HTLMStyle
-Link
and-Content
-AddComment
switchUntested:
-Css
-FilePath