diff --git a/README.md b/README.md
index e9968e0..c9f2a55 100644
--- a/README.md
+++ b/README.md
@@ -27,6 +27,9 @@ Sometimes, when you type too fast or copy prompts from all over the places, you
- [x] Toggle whether the above features are enabled / disabled by default in the `Prompt Format` section under the System category of the **Settings** tab
- [x] Pressing `Alt` + `Shift` + `F` can also trigger formatting
- [x] Assign "[alias](#tag-alias)" that counts as duplicates for the specified tags
+- [x] Exclude specific tags from `Remove Underscores`
+- [x] Click `Reload Cached Cards & Alias` to force a reload
+ - By default, the `ExtraNetwork` cards are cached once at the start, to be excluded from `Remove Underscores`. If you add more cards while the Webui is still running, you may click this to re-cache again.
### Tag Alias
diff --git a/README_ZH.md b/README_ZH.md
index 51d36de..e6cd7a6 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -27,6 +27,9 @@
- [x] 在 **Settings** 頁面 System 下的 `Prompt Format` 區可以 開啟/關閉 上述功能
- [x] 按下 `Alt` + `Shift` + `F` 亦可觸發格式化
- [x] 為指定單字新增 "[同義詞](#同義詞)"
+- [x] 將指定字詞除外 `Remove Underscores` 的影響
+- [x] 點擊 `Reload Cached Cards & Alias` 以重新載入
+ - 在一開始, `ExtraNetwork` 中的卡片會被緩存一次以防被 `Remove Underscores` 影響。如果你在 Webui 仍在運行時加入更多的卡片,點擊此按鈕來重新緩存。
### 同義詞
diff --git a/javascript/prompt_format_Configs.js b/javascript/prompt_format_Configs.js
index d090e25..fb46a1d 100644
--- a/javascript/prompt_format_Configs.js
+++ b/javascript/prompt_format_Configs.js
@@ -63,6 +63,9 @@ class LeFormatterConfig {
button.id = "setting_pf_reload";
button.textContent = "Reload Cached Cards & Alias";
+ button.style.borderRadius = "1em";
+ button.style.margin = "1em 0em 0em 0em";
+
page.appendChild(button);
return button;
}
@@ -79,6 +82,13 @@ class LeFormatterConfig {
cards.push(card.textContent);
});
+ const config = document.getElementById('setting_pf_exclusion').querySelector('input').value;
+ if (config.trim()) {
+ config.split(",").forEach((tag) => {
+ cards.push(tag.trim());
+ });
+ }
+
return cards;
}
diff --git a/scripts/pf_settings.py b/scripts/pf_settings.py
index a0c36d7..3513bf4 100644
--- a/scripts/pf_settings.py
+++ b/scripts/pf_settings.py
@@ -44,6 +44,22 @@ def on_settings():
),
)
+ opts.add_option(
+ "pf_exclusion",
+ OptionInfo(
+ default="",
+ label="Exclude Tags from Remove Underscores",
+ component=gr.Textbox,
+ component_args={
+ "placeholder": "score_9, score_8_up, score_7_up",
+ "lines": 1,
+ "max_lines": 1,
+ },
+ section=section,
+ category_id="system",
+ ),
+ )
+
opts.add_option(
"pf_alias",
OptionInfo(