No.However, would you normally have a line break before inline code?
selectedHtml = ed.html.getSelected();
<p>test test test</p>
test
the result of ed.html.getSelected()
is:<p>test</p>
[ICODE]<p>test</p>[/ICODE]
[ICODE]
test
[/ICODE]
<p><strong>test test test</strong></p>
<strong>
because otherwise that formatting could be lost (depending on what you're doing with the selection).<p></p>
if we're working with an inline tag, as we are here.
I can only just type some words like this and then select and put into icode.
I believe you instantly, I hear more people about that editor.I hate working with this editor.
I hate working with this editor.
ed.html.getSelected
is a buggy mess and behaves differently depending on the browser. It has some questionable behavior as you've discovered around the entire-line selection.XF.EditorHelpers.wrapSelectionText
works because Froala is just hard to work with. I think that is really the only sane thing todo in this stage.At this point it feels tempting to just remove the outer<p></p>
if we're working with an inline tag, as we are here.
This is an interesting thing.behaves differently depending on the browser.
I missed that workaround.I published my work-around for the behavior you've documented in this post. I think this is the 4th or maybe 5th iteration of patching howXF.EditorHelpers.wrapSelectionText
works because Froala is just hard to work with.
At least this version I haven't had to patch since February!
test <p>[ICODE]test[/ICODE]</p> test
test
[ICODE]test[/ICODE]
test
Froala has a bunch of dubious per-browser-type behavior that is hard to troubleshoot. It wouldn't surprise me if it was related.This is an interesting thing.
Since you say "depending on the browser", could it have caused this issue too since 2.2.7?
It adds a 5th parameter toI missed that workaround.
I just implemented it and, while it helps with this issue, what actually happens now is this is inserted (in Safari and Firefox):
wrapSelectionText
the inline
flag. Did you patch the [icode]
(and [ispoiler]
) handler to set that 5th argument so it strips out the <p>
tag?We use essential cookies to make this site work, and optional cookies to enhance your experience.