We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db90a71 commit 6bf463cCopy full SHA for 6bf463c
_plugins/asciidoctor-extension.rb
@@ -52,6 +52,21 @@
52
end
53
54
55
+def escape_double_quotes(str)
56
+ str.gsub(/"/) { |x| %(\\\\#{x}) }
57
+end
58
+
59
+Extensions.register do
60
+ inline_macro do
61
+ named :config_property_copy_button
62
+ resolve_attributes false
63
+ process do |parent, target, attrs|
64
+ config_property = escape_double_quotes(target)
65
+ copy_btn = %(<button class="btn-copy fa fa-clipboard inline-btn-copy" data-clipboard-action="copy" data-clipboard-text="#{config_property}" title="Copy to clipboard" do-not-collapse="true"></button>)
66
+ create_inline_pass parent, %(#{copy_btn})
67
+ end
68
69
70
71
### ALL CONFIG page processors
72
0 commit comments