living-documentation 4.3.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -223,6 +223,9 @@ function extractWordsFromFile(text, ext) {
|
|
|
223
223
|
text = text.replace(/\b(className|onClick|onChange|onSubmit|onFocus|onBlur|onKeyDown|onKeyUp|onMouseDown|onMouseUp|htmlFor|tabIndex|strokeWidth|viewBox|fillOpacity|strokeOpacity|defaultValue|placeholder|disabled|checked|readOnly|required|multiple|autoFocus|autoComplete|type|href|src|alt|width|height|style|key|ref)\s*=/g, ' =');
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
// Strip import/package/namespace/using/require lines before any extraction
|
|
227
|
+
text = text.replace(/^\s*(import\s+[\w.*{},\s'"@/-]+;?|from\s+['"][^'"]+['"]\s*;?|package\s+[\w.]+;?|namespace\s+[\w.]+;?|using\s+[\w.]+;?|require\s*\(?\s*['"][^'"]+['"]\s*\)?;?)\s*$/gm, '');
|
|
228
|
+
|
|
226
229
|
// Extract from line comments (// # --)
|
|
227
230
|
text.replace(/(?:\/\/|#(?!.*[{}[\]<>])| -- )\s*(.+)$/gm, (_, c) => {
|
|
228
231
|
words.push(...wcTokenize(c));
|
|
@@ -551,6 +554,12 @@ function wcSelectFolder() {
|
|
|
551
554
|
document.getElementById('wc-root').value = _wcBrowseCurrent;
|
|
552
555
|
localStorage.setItem('wc-root', _wcBrowseCurrent);
|
|
553
556
|
document.getElementById('wc-browser').classList.add('hidden');
|
|
557
|
+
|
|
558
|
+
// Reset exclude field and sync exclude browser path to new root
|
|
559
|
+
const ta = document.getElementById('wc-exclude');
|
|
560
|
+
ta.value = '';
|
|
561
|
+
localStorage.removeItem('wc-exclude');
|
|
562
|
+
_wcExclBrowseCurrent = _wcBrowseCurrent;
|
|
554
563
|
}
|
|
555
564
|
|
|
556
565
|
// ── Persistence (localStorage) ────────────────────────────────────────────────
|