Remove "include newlines" checkbox from context formatting settings
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": false, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": true, |
| 11 | 10 | "name": "Adventure" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Alpaca-Roleplay" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": false, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Alpaca-Single-Turn" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Alpaca" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "ChatML-Names" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "ChatML" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Command R" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Default" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": false, |
| 8 | 8 | "trim_sentences": true, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "DreamGen Role-Play V1 ChatML" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": false, |
| 8 | 8 | "trim_sentences": true, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "DreamGen Role-Play V1 Llama3" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Gemma 2" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Libra-32B" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Lightning 1.1" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Llama 2 Chat" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Llama 3 Instruct" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Llama-3-Instruct-Names" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Minimalist" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Mistral V1" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Mistral V2 & V3" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Mistral V3-Tekken" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "NovelAI" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "OldDefault" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Phi" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Pygmalion" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Story" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "Synthia" |
| 12 | 11 | } |
| @@ -6,7 +6,6 @@ | ||
| 6 | 6 | "allow_jailbreak": false, |
| 7 | 7 | "always_force_name2": true, |
| 8 | 8 | "trim_sentences": false, |
| 9 | - "include_newline": false, | |
| 10 | 9 | "single_line": false, |
| 11 | 10 | "name": "simple-proxy-for-tavern" |
| 12 | -} | |
| 12 | \ No newline at end of file | |
| 11 | +} | |
| @@ -90,7 +90,6 @@ | ||
| 90 | 90 | "pin_examples": false, |
| 91 | 91 | "strip_examples": false, |
| 92 | 92 | "trim_sentences": false, |
| 93 | - "include_newline": false, | |
| 94 | 93 | "always_force_name2": true, |
| 95 | 94 | "user_prompt_bias": "", |
| 96 | 95 | "show_user_prompt_bias": true, |
| @@ -3251,11 +3251,6 @@ | ||
| 3251 | 3251 | Trim Incomplete Sentences |
| 3252 | 3252 | </small> |
| 3253 | 3253 | </label> |
| 3254 | - <!-- Add margin since this is a child of above --> | |
| 3255 | - <label class="checkbox_label indent20p" for="include_newline_checkbox"> | |
| 3256 | - <input id="include_newline_checkbox" type="checkbox" /> | |
| 3257 | - <small data-i18n="Include Newline">Include Newline</small> | |
| 3258 | - </label> | |
| 3259 | 3254 | <label class="checkbox_label" title="Add Chat Start and Example Separator to a list of stopping strings." data-i18n="[title]Add Chat Start and Example Separator to a list of stopping strings."> |
| 3260 | 3255 | <input id="context_use_stop_strings" type="checkbox" /> |
| 3261 | 3256 | <small data-i18n="Separators as Stop Strings">Separators as Stop Strings</small> |
| @@ -5480,7 +5480,7 @@ export function cleanUpMessage(getMessage, isImpersonate, isContinue, displayInc | ||
| 5480 | 5480 | } |
| 5481 | 5481 | |
| 5482 | 5482 | if (!displayIncompleteSentences && power_user.trim_sentences) { |
| 5483 | 5483 | getMessage = trimToEndSentence(getMessage, power_user.include_newline); |
| 5484 | 5484 | } |
| 5485 | 5485 | |
| 5486 | 5486 | if (power_user.trim_spaces) { |
| @@ -114,7 +114,6 @@ let power_user = { | ||
| 114 | 114 | pin_examples: false, |
| 115 | 115 | strip_examples: false, |
| 116 | 116 | trim_sentences: false, |
| 117 | - include_newline: false, | |
| 118 | 117 | always_force_name2: false, |
| 119 | 118 | user_prompt_bias: '', |
| 120 | 119 | show_user_prompt_bias: true, |
| @@ -317,7 +316,6 @@ const contextControls = [ | ||
| 317 | 316 | // Existing power user settings |
| 318 | 317 | { id: 'always-force-name2-checkbox', property: 'always_force_name2', isCheckbox: true, isGlobalSetting: true, defaultValue: true }, |
| 319 | 318 | { id: 'trim_sentences_checkbox', property: 'trim_sentences', isCheckbox: true, isGlobalSetting: true, defaultValue: false }, |
| 320 | - { id: 'include_newline_checkbox', property: 'include_newline', isCheckbox: true, isGlobalSetting: true, defaultValue: false }, | |
| 321 | 319 | { id: 'single_line', property: 'single_line', isCheckbox: true, isGlobalSetting: true, defaultValue: false }, |
| 322 | 320 | ]; |
| 323 | 321 | |
| @@ -1487,7 +1485,6 @@ async function loadPowerUserSettings(settings, data) { | ||
| 1487 | 1485 | $('#collapse-newlines-checkbox').prop('checked', power_user.collapse_newlines); |
| 1488 | 1486 | $('#always-force-name2-checkbox').prop('checked', power_user.always_force_name2); |
| 1489 | 1487 | $('#trim_sentences_checkbox').prop('checked', power_user.trim_sentences); |
| 1490 | - $('#include_newline_checkbox').prop('checked', power_user.include_newline); | |
| 1491 | 1488 | $('#render_formulas').prop('checked', power_user.render_formulas); |
| 1492 | 1489 | $('#disable_group_trimming').prop('checked', power_user.disable_group_trimming); |
| 1493 | 1490 | $('#markdown_escape_strings').val(power_user.markdown_escape_strings); |
| @@ -3069,19 +3066,6 @@ $(document).ready(() => { | ||
| 3069 | 3066 | // if trim sentences is unchecked, include newline must be unchecked |
| 3070 | 3067 | $('#trim_sentences_checkbox').change(function () { |
| 3071 | 3068 | power_user.trim_sentences = !!$(this).prop('checked'); |
| 3072 | - if (!$(this).prop('checked')) { | |
| 3073 | - $('#include_newline_checkbox').prop('checked', false); | |
| 3074 | - power_user.include_newline = false; | |
| 3075 | - } | |
| 3076 | - saveSettingsDebounced(); | |
| 3077 | - }); | |
| 3078 | - | |
| 3079 | - $('#include_newline_checkbox').change(function () { | |
| 3080 | - power_user.include_newline = !!$(this).prop('checked'); | |
| 3081 | - if ($(this).prop('checked')) { | |
| 3082 | - $('#trim_sentences_checkbox').prop('checked', true); | |
| 3083 | - power_user.trim_sentences = true; | |
| 3084 | - } | |
| 3085 | 3069 | saveSettingsDebounced(); |
| 3086 | 3070 | }); |
| 3087 | 3071 | |
| @@ -607,12 +607,11 @@ export function sortByCssOrder(a, b) { | ||
| 607 | 607 | /** |
| 608 | 608 | * Trims a string to the end of a nearest sentence. |
| 609 | 609 | * @param {string} input The string to trim. |
| 610 | - * @param {boolean} include_newline Whether to include a newline character in the trimmed string. | |
| 611 | 610 | * @returns {string} The trimmed string. |
| 612 | 611 | * @example |
| 613 | 612 | * trimToEndSentence('Hello, world! I am from'); // 'Hello, world!' |
| 614 | 613 | */ |
| 615 | 614 | export function trimToEndSentence(input, include_newline = false) { |
| 616 | 615 | if (!input) { |
| 617 | 616 | return ''; |
| 618 | 617 | } |
| @@ -633,11 +632,6 @@ export function trimToEndSentence(input, include_newline = false) { | ||
| 633 | 632 | } |
| 634 | 633 | break; |
| 635 | 634 | } |
| 636 | - | |
| 637 | - if (include_newline && char === '\n') { | |
| 638 | - last = i; | |
| 639 | - break; | |
| 640 | - } | |
| 641 | 635 | } |
| 642 | 636 | |
| 643 | 637 | if (last === -1) { |