X-Git-Url: https://git.ktnx.net/?p=icedeb.git;a=blobdiff_plain;f=icedeb.js;h=29327a85166cc6df8d45d018bf7421f6a4be7b20;hp=e6525400eb2eb65a9d31e8e522166213726719b5;hb=7c295465c545334178efd5b6647a75ca3052dff8;hpb=3af5ba27499882e8b446135dcc3e8170168149d6 diff --git a/icedeb.js b/icedeb.js index e652540..29327a8 100644 --- a/icedeb.js +++ b/icedeb.js @@ -30,6 +30,7 @@ function trim(word) { word = word.replace(/^[^a-zA-Z0-9]+/, ''); word = word.replace(/[^a-zA-Z0-9]+$/, ''); word = word.replace(/^Bug#/i, ''); + word = word.replace(/^#/, ''); } while ( oldword != word ); return word; @@ -173,12 +174,15 @@ function link_clicked(e) { function check_likely_inputs(q) { let cnt = document.getElementById('button-list-container').classList; - cnt.remove('like-b', 'like-p', 'like-m', 'like-i'); + cnt.remove('like-b', 'like-p', 'like-m', 'like-i', 'like-s'); document.querySelectorAll('.likely') .forEach((el) => { el.classList.remove('likely'); }); + q = q.replace(/^\s+/, ''); + q = q.replace(/\s+$/, ''); + if ( /^#?\d+$/.test(q) || /^CVE-/.test(q) ) cnt.add('like-b'); @@ -191,7 +195,10 @@ function check_likely_inputs(q) { if ( /^<.+@.+>$/.test(q) ) cnt.add('like-i'); - document.querySelectorAll('.like-b .hint.b, .like-p .hint.p, .like-m .hint.m, .like-i .hint.i') + if ( /^d[sl]a[- ]\d+(-\d+)?$/i.test(q) ) + cnt.add('like-s'); + + document.querySelectorAll('.like-b .hint.b, .like-p .hint.p, .like-m .hint.m, .like-i .hint.i, .like-s .hint.s') .forEach((el) => { el.parentElement.parentElement.classList.add('likely'); } );