1
0
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:
Lindsey Barbee-Vargas
2020-07-10 16:56:00 -04:00
committed by openshift-cherrypick-robot
parent ac69bc1933
commit 345ebcf391

View File

@@ -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);