diff options
author | Paul Twohey <twohey@users.noreply.github.com> | 2019-08-28 21:00:00 -0700 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-09-01 20:51:15 +0200 |
commit | 99bd271b3574a1242e9d28765952abe49d1ef0be (patch) | |
tree | fd84ad1e840a9d02eef27f3d301e00b308236386 /layouts | |
parent | 8f1cdb6aee42d687d9f0574409b846b747e2960e (diff) |
fix expand and tabs shortcodes to work with strict Content-Security-Policy
When the Content-Security-Policy header has "style-src 'self';"
inine style elements like style="display: none" are not honored
by browsers, so add CSS to the markup classes and style them
display: none
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/shortcodes/expand.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/tabs.html | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html index 547fb3f..d6b7522 100644 --- a/layouts/shortcodes/expand.html +++ b/layouts/shortcodes/expand.html @@ -4,7 +4,7 @@ <span>{{ default "Expand" (.Get 0) }}</span> <span>{{ default "↕" (.Get 1) }}</span> </div> - <input type="checkbox" style="display: none" /> + <input type="checkbox" class="book-expand-expander" /> <div class="book-expand-content markdown-inner"> {{ .Inner | markdownify }} </div> diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html index 88bb8e7..c49b141 100644 --- a/layouts/shortcodes/tabs.html +++ b/layouts/shortcodes/tabs.html @@ -4,7 +4,7 @@ <div class="book-tabs"> {{ range $index, $tab := .Scratch.Get $group }} - <input type="radio" name="{{ $group }}" style="display: none;" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} /> + <input type="radio" class="book-tabs-radio" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} /> <label for="{{ printf "%s-%d" $group $index }}"> {{ $tab.Name }} </label> |