Skip to content

Commit 839c5c8

Browse files
AmirMohammad CheraghaliAmirMohammad Cheraghali
authored andcommitted
fix: use Markdown for template insertion to prevent HTML escaping
1 parent d5e87ea commit 839c5c8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/components/dashboard/RichTextEditor.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,19 +207,19 @@ export const RichTextEditor: React.FC<RichTextEditorProps> = ({
207207
let content = '';
208208
switch (template) {
209209
case 'protocol':
210-
content = '<p><strong>Protocol:</strong></p><ul><li></li></ul>';
210+
content = '**Protocol:**\n\n- ';
211211
break;
212212
case 'observation':
213-
content = '<p><strong>Observation:</strong></p><p></p>';
213+
content = '**Observation:**\n\n';
214214
break;
215215
case 'result':
216-
content = '<p><strong>Result:</strong></p><p></p>';
216+
content = '**Result:**\n\n';
217217
break;
218218
case 'setup':
219-
content = '<p><strong>Experiment Setup:</strong></p><p>Sample ID: </p><p>Buffer: </p><p>Temperature: </p>';
219+
content = '**Experiment Setup:**\n\nSample ID: \nBuffer: \nTemperature: ';
220220
break;
221221
default:
222-
content = `<p><strong>${template}:</strong></p>`;
222+
content = `**${template}:**\n\n`;
223223
}
224224
editor.chain().focus().insertContent(content).run();
225225
setActiveMenu(null);

0 commit comments

Comments
 (0)