mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
Updated clipboardJS regex when checking for $ in code blocks
This commit is contained in:
committed by
openshift-cherrypick-robot
parent
ac69bc1933
commit
345ebcf391
@@ -11,7 +11,7 @@ document.querySelectorAll('span.clipboard-button').forEach((copybutton, index) =
|
||||
var clipboard = new ClipboardJS('.clipboard-button', {
|
||||
text: function(target) {
|
||||
const targetId = target.getAttribute('data-clipboard-target').substr(1);
|
||||
const clipboardText = document.getElementById(targetId).innerText.replace(/\$\s/g, "");
|
||||
const clipboardText = document.getElementById(targetId).innerText.replace(/\$[ ]/g, "");
|
||||
|
||||
if (clipboardText.slice(0, 2) === "# ") {
|
||||
return clipboardText.substr(2);
|
||||
|
||||
Reference in New Issue
Block a user