Skip to content

Commit 540d5a1

Browse files
committed
Remove template string trimming to preserve whitespace during editing
- should not trim templates upon saving └── apps └── editor ├── package.json └── src └── views └── settings ├── backend │ ├── message-handlers │ │ └── handle-update-templates.ts │ └── settings-view-provider.ts ├── frontend │ ├── Settings.tsx │ ├── forms │ │ ├── EditTemplateForm │ │ │ └── EditTemplateForm.tsx │ │ └── TemplatesForm │ │ └── TemplatesForm.tsx │ └── hooks │ ├── use-settings.ts │ └── use-template-editing.ts └── types └── messages.ts
1 parent 69a54d0 commit 540d5a1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/editor/src/views/settings/frontend/forms/EditTemplateForm/EditTemplateForm.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const EditTemplateForm: React.FC<Props> = (props) => {
2828
useEffect(() => {
2929
props.on_update({
3030
name: name.trim() || undefined,
31-
template: template.trim()
31+
template
3232
})
3333
}, [name, template, props.on_update])
3434

‎apps/editor/src/views/settings/frontend/hooks/use-template-editing.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export const use_template_editing = (
4141
const b = updated_template
4242
const a_name = (a.name || '').trim()
4343
const b_name = (b.name || '').trim()
44-
const a_template = a.template.trim()
45-
const b_template = b.template.trim()
44+
const a_template = a.template
45+
const b_template = b.template
4646
const has_changes = a_name !== b_name || a_template !== b_template
4747

4848
if (has_changes) {

0 commit comments

Comments
 (0)