diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2019-04-02 06:21:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-02 06:21:53 +0200 |
| commit | c8a43bbe1df0ecc11022794ef94538f3b1ba31f2 (patch) | |
| tree | 4d6d1cdc93777019407af8e261372a5f8fdb88f0 /print/resources | |
| parent | d0ce93649d601a0a87919bd13a8c562f1b7a12a3 (diff) | |
prevent html from showing up in custom text field (#421)
Diffstat (limited to 'print/resources')
| -rw-r--r-- | print/resources/inkstitch.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/print/resources/inkstitch.js b/print/resources/inkstitch.js index 79c6d9c3..86bc213e 100644 --- a/print/resources/inkstitch.js +++ b/print/resources/inkstitch.js @@ -324,10 +324,10 @@ $(function() { } else if (item.is('figure.inksimulation')) { setSVGTransform(item, value); } else if (item.is('div.footer-info')) { - $('#footer-info-text').html(value); - item.html(value); + $('#footer-info-text').html($.parseHTML(value)); + item.html($.parseHTML(value)); } else if (item.is('#custom-page-content')) { - $('#custom-page-content').html(value); + $('#custom-page-content').html($.parseHTML(value)); } else { item.text(value); } @@ -431,7 +431,7 @@ $(function() { } else { info_text.css('display', 'block'); var sourceText = info_text.text(); - info_text.html( sourceText ); + info_text.html( $.parseHTML(sourceText) ); element.closest('.tool-bar').find('.tb-button.edit-only').prop('disabled', false); } }); @@ -439,7 +439,6 @@ $(function() { function updateEditableText(element) { var editMode = getEditMode(element); var info_text = element.closest('fieldset').find('.info-text'); - var content = info_text.html(); var editableText = ''; if (editMode) { @@ -449,10 +448,10 @@ $(function() { } if(info_text.is('#footer-info-text')) { - $('div.footer-info').html(editableText); - $.postJSON('/settings/footer-info', {value: content}); + $('div.footer-info').html($.parseHTML(editableText)); + $.postJSON('/settings/footer-info', {value: editableText}); } else { - $.postJSON('/settings/custom-page-content', {value: content}); + $.postJSON('/settings/custom-page-content', {value: editableText}); } } |
