Fossil SCM

Added error handling around default paragraph style.

vor0nwe 2018-10-30 18:14 vor0nwe-wiki-wysiwyg
Commit 2f0fa68b013fea58e5dacc8d138370ced7ff1b22d8323e55c114aceedff7913f
1 file changed +4 -1
+4 -1
--- src/wysiwyg.c
+++ src/wysiwyg.c
@@ -218,11 +218,14 @@
218218
@ /* Initialize the document editor */
219219
@ function initDoc() {
220220
@ initEventHandlers();
221221
@ oDoc = document.getElementById("wysiwygBox");
222222
@ if (!isWysiwyg()) { setDocMode(true); }
223
- @ document.execCommand("defaultParagraphSeparator", false, "p");
223
+ @ try {
224
+ @ document.execCommand("defaultParagraphSeparator", false, "p");
225
+ @ } catch {
226
+ @ }
224227
@ }
225228
@
226229
@ function initEventHandlers() {
227230
@ document.querySelector('form').onsubmit = wysiwygSubmit;
228231
@ document.querySelector('#editMode').onchange = function() {
229232
--- src/wysiwyg.c
+++ src/wysiwyg.c
@@ -218,11 +218,14 @@
218 @ /* Initialize the document editor */
219 @ function initDoc() {
220 @ initEventHandlers();
221 @ oDoc = document.getElementById("wysiwygBox");
222 @ if (!isWysiwyg()) { setDocMode(true); }
223 @ document.execCommand("defaultParagraphSeparator", false, "p");
 
 
 
224 @ }
225 @
226 @ function initEventHandlers() {
227 @ document.querySelector('form').onsubmit = wysiwygSubmit;
228 @ document.querySelector('#editMode').onchange = function() {
229
--- src/wysiwyg.c
+++ src/wysiwyg.c
@@ -218,11 +218,14 @@
218 @ /* Initialize the document editor */
219 @ function initDoc() {
220 @ initEventHandlers();
221 @ oDoc = document.getElementById("wysiwygBox");
222 @ if (!isWysiwyg()) { setDocMode(true); }
223 @ try {
224 @ document.execCommand("defaultParagraphSeparator", false, "p");
225 @ } catch {
226 @ }
227 @ }
228 @
229 @ function initEventHandlers() {
230 @ document.querySelector('form').onsubmit = wysiwygSubmit;
231 @ document.querySelector('#editMode').onchange = function() {
232

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button