From 345a9421d3b22545b30cf6cbd17fc07afd0d0b8e Mon Sep 17 00:00:00 2001 From: Osama M <49054601+webdev51@users.noreply.github.com> Date: Wed, 6 Sep 2023 17:09:58 +0500 Subject: [PATCH] fixed "disable copy" feature bug for newer Hugo version (#811) --- assets/scss/_styles_project.scss | 5 ++++- layouts/shortcodes/command.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index 0237770a32..e5cf07acc5 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -524,7 +524,6 @@ table tfoot { } .td-content, body{ .code-container { - position: relative; .code-copy-button { position: absolute; top: 0; @@ -565,4 +564,8 @@ table tfoot { } } +.disable-copy{ + display: inline; +} + @import "modules/academy-styles.scss"; diff --git a/layouts/shortcodes/command.html b/layouts/shortcodes/command.html index 8019c9d0cd..76dac62278 100644 --- a/layouts/shortcodes/command.html +++ b/layouts/shortcodes/command.html @@ -10,7 +10,7 @@ {{ $options = . }} {{ end }} {{ $highlighted := highlight $inner "text" $options }} -{{ $highlighted := replaceRE `###DISABLE_COPY###(?s)(.*?)###DISABLE_COPY_END###` "$1" $highlighted | safeHTML}} +{{ $highlighted := replaceRE `###DISABLE_COPY###(?s)(.*?)###DISABLE_COPY_END###` "