From 6094cf393a6aad8210b0df5b4e62822cf7c5666f Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Tue, 13 Sep 2022 11:07:41 +0300 Subject: [PATCH] copybutton_exclude: Add .gp to default exclusion - `.linenos` is the line numbers, and `.gp` is the tag from the pygments highlighter for things like the `$` prompt. Upstream sphinx CSS excludes `.gp` from being copied, see the analysis here: https://github.com/executablebooks/sphinx-copybutton/pull/138#issuecomment-1157524477 - If upstream sphinx excludes `.gp`, we probably should as well. --- sphinx_copybutton/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx_copybutton/__init__.py b/sphinx_copybutton/__init__.py index aed1581..b52a72a 100644 --- a/sphinx_copybutton/__init__.py +++ b/sphinx_copybutton/__init__.py @@ -81,7 +81,7 @@ def setup(app): app.add_config_value("copybutton_here_doc_delimiter", "", "html") app.add_config_value("copybutton_image_svg", "", "html") app.add_config_value("copybutton_selector", "div.highlight pre", "html") - app.add_config_value("copybutton_exclude", ".linenos", "html") + app.add_config_value("copybutton_exclude", ".linenos, .gp", "html") # DEPRECATE THIS AFTER THE NEXT RELEASE app.add_config_value("copybutton_image_path", "", "html")