Python Forum
CKEditor / Rin Editor
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CKEditor / Rin Editor
#81
"Insert Paragraph Here".  Also, I've been able to fairly reliably reproduce it.  If you paste a code snippet into the quick reply, after copying it from a python code box in someone's post, it's reformatted to be near meaningless.

ex: copy this, and paste it into the quick reply:
for ndx in range(5):
    print(ndx)
    if ndx % 2 == 0:
        print("^^ is even!")
While testing, I've found this to not be the case with ONLY the quick reply.  EITHER editor exhibits this errant behavior.

Attached Files

Thumbnail(s)
   
Reply
#82
Is follow: Python Code: (Double-click to select all)
So Double-click will mark all,then copy it's okay.
As i have done here in Quick Reply.
for ndx in range(5):
    print(ndx)
    if ndx % 2 == 0:
        print("^^ is even!")
Mark all code yourself and paste with Ctrl+v and source mode off it's not okay.
If  paste in with Ctrl-Shift+v it's okay in both cases.
If source mode on it's also okay in both cases.

It's work okay now excepted for some corner cases,
most code we see posted now has indentation(that they forget code tag is some cases is excepted).
Reply
#83
(Aug-05-2017, 05:38 PM)nilamo Wrote: Also, there's a weird red dashed line with a caption of either "create line break here" or "add paragraph here".
i actually like this feature. This is from CKeditor and as well in Rin Editor too. This occurs when you are in WYSIWYG editor mode and you hover your mouse over what seems to be "non-newlines" that are before, in between, or after default BBCode tags that does not have a newline spaced between. The reason i like it is there is no way to get a newline before a quote for example when the quote is the initial post without going into source mode. So that allows you to stay in WYSWIYG mode to add a newline.

Attached Files

Thumbnail(s)
   
Recommended Tutorials:
Reply
#84
[code]for[/code]
[code]ndx[/code]
[code]in[/code]
[code]range[/code]
[code]([/code]
[code]5[/code]
[code]):[/code]
[code]    [/code]
[code]print[/code]
[code](ndx)[/code]
[code]    [/code]
[code]if[/code]
[code]ndx[/code]
[code]%[/code]
[code]2[/code]
[code]=[/code]
[code]=[/code]
[code]0[/code]
[code]:[/code]
[code]        [/code]
[code]print[/code]
[code]([/code]
[code]"^^ is even!"[/code]
[code])[/code]
to reproduce...copy the selected code by manually dragging mouse over text, in quick reply first select to switch to WYSIWYG mode (indicated by the format text button NOT grayed out), then hit python code BBcode button, then paste code, then preview.

This occurs because of being in WYSIWYG mode and pasting via Ctrl + v instead of pasting as plain text via Ctrl + SHIFT + V. To fix either stay in source mode, or use Ctrl SHIFT V to paste as plain text in WYSIWYG mode
Recommended Tutorials:
Reply
#85
(Aug-05-2017, 09:26 PM)metulburr Wrote: to reproduce...in quick reply first select to switch to WYSIWYG mode (indicated by the format text button NOT grayed out), then hit python code BBcode button, then paste code, then preview
If follow advice (Double-click to select all) then copy it dos not matter source mode or not Ctrl+v/Ctrl+Shift+v or not.
To reproduce has to copy code without using Double-click,then is what you saying correct.
Reply
#86
ah yeah it is if you only copy and paste not via double click
Recommended Tutorials:
Reply
#87
(Jul-29-2017, 12:46 PM)nilamo Wrote:
(Jul-28-2017, 05:05 PM)metulburr Wrote: Ive tried numerous time. Even went into chrome settings and cleared everything out, including password, cached images, browser history, etc. Tried a lot of times with Ctrl + F5. I cant seem to get it to work at all.

It works for me on Chrome, on Windows.
It DOES NOT work in Internet Explorer.  Furthermore, opening IE's dev tools to try to find out why actually crashes the browser.
It also DOES NOT work in Edge.  But the dev tools DO work here, and I see an error (.append does not exist).

Edge is actually fairly standards compliant, which means there's probably an actual issue with how I was doing it before.  This new version works in all the browsers I've tested.  I think the issue boils down to the fact that the new quick-editor is in an iframe, and different browsers treat iframes differently.  .append() is a jquery thing, so I changed it to just use raw DOM manipulation instead.
function insert_text(text, spaces, popup)
{
    var textarea;
 
    if (!popup)
    {
        //textarea = document.forms[form_name].elements[text_name];
        textarea = document.forms[form_name].getElementsByTagName("iframe")[0].contentDocument.body;
    }
    else
    {
        textarea = opener.document.forms[form_name].elements[text_name];
    }
    if (spaces)
    {
        text = ' ' + text + ' ';
    }
    if (!isNaN(textarea.selectionStart))
    {
        var sel_start = textarea.selectionStart;
        var sel_end = textarea.selectionEnd;
 
        mozWrap(textarea, text, '');
        textarea.selectionStart = sel_start + text.length;
        textarea.selectionEnd = sel_end + text.length;
    }
 
    else if (textarea.createTextRange && textarea.caretPos)
    {
        if (baseHeight != textarea.caretPos.boundingHeight)
        {
            setTimeout(function() { textarea.focus(); }, 10);
            storeCaret(textarea);
        }
        var caret_pos = textarea.caretPos;
        caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
 
    }
    else
    {
        if (popup) {
            textarea.value = textarea.value + text;
        } else {
            var content = document.createElement("span");
            content.innerHTML = text;
            textarea.appendChild(content);
        }
    }
    if (!popup)
    {
        //setTimeout(function() { textarea.focus(); }, 10);
    }
}

Back to the issue regarding the fast quote i have been having....If i look at the source code, in firefox it shows an iframe, but it does not shows the same iframe for me in chrome, but a textarea. Might this be why i am not having it work in chrome? The screenshot given is of chrome on left and firefox on right, with the same location for inspection. firefox shows the iframe, but chrome shows a textarea.

Attached Files

Thumbnail(s)
   
Recommended Tutorials:
Reply
#88
In code blocks, if you have an empty list: [], and then preview the post, the editor will then remove the empty list. 

items = ["spam"] # fine
items = # uh oh
If you post without previewing, there is no issue. Which means I've looked a post over, then posted it, only to realize what was actually posted was broken code.

*edit, also happened to the icode.  So it's not the code tags, it's the editor that's stripping out the brackets.

Does it happen if there's even just space there?  [ ]
**edit 2, nope, if there's a space between the brackets, they're not stripped.  It's only literally [] that's an issue.
Reply
#89
test=[]
test = []
i cant replicate this. Are you in source mode in the editor? The editor does some weird shit when in WYSIWYG mode.
Recommended Tutorials:
Reply
#90
Seems to happen both ways. Or maybe the wysiwyg is the only thing that removes them, but since that's the default, they get stripped out when you preview the post.

test=
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020