diff --git a/Gemfile.checksum b/Gemfile.checksum index 8d990adcd94..25874b0ecaa 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -257,7 +257,7 @@ {"name":"hashdiff","version":"1.0.1","platform":"ruby","checksum":"2cd4d04f5080314ecc8403c4e2e00dbaa282dff395e2d031bc16c8d501bdd6db"}, {"name":"hashie","version":"4.1.0","platform":"ruby","checksum":"7890dcb9ec18a4b66acec797018c73824b89cef5eb8cda36e8e8501845e87a09"}, {"name":"hashie-forbidden_attributes","version":"0.1.1","platform":"ruby","checksum":"3a6ed37f3a314e4fb1dd1e2df6eb7721bcadd023a30bc0b951b2b5285a790fb2"}, -{"name":"health_check","version":"3.0.0","platform":"ruby","checksum":"1b336c5c49036a993153e75c8d14e9742377fb9b7361c0a6af2e5fedb45b991f"}, +{"name":"health_check","version":"3.1.0","platform":"ruby","checksum":"10146508237dc54ed7e24c292d8ba7fb8f9590cf26c66e325b947438c4103b57"}, {"name":"heapy","version":"0.2.0","platform":"ruby","checksum":"74141e845d61ffc7c1e8bf8b127c8cf94544ec7a1181aec613288682543585ea"}, {"name":"html-pipeline","version":"2.13.2","platform":"ruby","checksum":"a1de83f7bd2d3464f3a068e391b661983fc6099d194c8d9ceb91ace02dadb803"}, {"name":"html2text","version":"0.2.0","platform":"ruby","checksum":"31c2f0be9ab7aa4fc780b07d5f84882ebc22a9024c29a45f4f5adfe42e92ad4f"}, diff --git a/Gemfile.lock b/Gemfile.lock index 75d0c5ace89..2daa5ab67c8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,6 +15,7 @@ PATH specs: devise-pbkdf2-encryptable (0.0.0) devise (~> 4.0) + devise-two-factor (~> 4.0) PATH remote: vendor/gems/error_tracking_open_api @@ -711,7 +712,7 @@ GEM hashie (4.1.0) hashie-forbidden_attributes (0.1.1) hashie (>= 3.0) - health_check (3.0.0) + health_check (3.1.0) railties (>= 5.0) heapy (0.2.0) thor diff --git a/app/assets/javascripts/code_navigation/utils/dom_utils.js b/app/assets/javascripts/code_navigation/utils/dom_utils.js index 90af31b715c..66770cca8a2 100644 --- a/app/assets/javascripts/code_navigation/utils/dom_utils.js +++ b/app/assets/javascripts/code_navigation/utils/dom_utils.js @@ -6,26 +6,28 @@ const isBlank = (str) => !str || /^\s*$/.test(str); const isMatch = (s1, s2) => !isBlank(s1) && s1.trim() === s2.trim(); -const createSpan = (content) => { +const createSpan = (content, classList) => { const span = document.createElement('span'); span.innerText = content; + span.classList = classList || ''; return span; }; -const wrapSpacesWithSpans = (text) => text.replace(/ /g, createSpan(' ').outerHTML); +const wrapSpacesWithSpans = (text) => + text.replace(/ /g, createSpan(' ').outerHTML).replace(/\t/g, createSpan(' ').outerHTML); -const wrapTextWithSpan = (el, text) => { +const wrapTextWithSpan = (el, text, classList) => { if (isTextNode(el) && isMatch(el.textContent, text)) { - const newEl = createSpan(text.trim()); + const newEl = createSpan(text.trim(), classList); el.replaceWith(newEl); } }; -const wrapNodes = (text) => { +const wrapNodes = (text, classList) => { const wrapper = createSpan(); // eslint-disable-next-line no-unsanitized/property wrapper.innerHTML = wrapSpacesWithSpans(text); - wrapper.childNodes.forEach((el) => wrapTextWithSpan(el, text)); + wrapper.childNodes.forEach((el) => wrapTextWithSpan(el, text, classList)); return wrapper.childNodes; }; diff --git a/app/assets/javascripts/code_navigation/utils/index.js b/app/assets/javascripts/code_navigation/utils/index.js index 46038df2f86..7a5fa9f4a35 100644 --- a/app/assets/javascripts/code_navigation/utils/index.js +++ b/app/assets/javascripts/code_navigation/utils/index.js @@ -17,11 +17,9 @@ export const addInteractionClass = ({ path, d, wrapTextNodes }) => { if (wrapTextNodes) { line.childNodes.forEach((elm) => { - if (isTextNode(elm)) { - // Highlight.js does not wrap all text nodes by default - // We need all text nodes to be wrapped in order to append code nav attributes - elm.replaceWith(...wrapNodes(elm.textContent)); - } + // Highlight.js does not wrap all text nodes by default + // We need all text nodes to be wrapped in order to append code nav attributes + elm.replaceWith(...wrapNodes(elm.textContent, elm.classList)); }); } diff --git a/app/assets/javascripts/ide/components/jobs/detail/description.vue b/app/assets/javascripts/ide/components/jobs/detail/description.vue index c184e25f67f..00059d01308 100644 --- a/app/assets/javascripts/ide/components/jobs/detail/description.vue +++ b/app/assets/javascripts/ide/components/jobs/detail/description.vue @@ -23,7 +23,12 @@ export default {