Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lines disappear at press Code button (WYSIWYG to BBCode) #40

Open
quimlc opened this issue May 14, 2018 · 0 comments
Open

Lines disappear at press Code button (WYSIWYG to BBCode) #40

quimlc opened this issue May 14, 2018 · 0 comments

Comments

@quimlc
Copy link

quimlc commented May 14, 2018

Hi! I think there is some problem with the programation because when I paste some text copied from a website in the WYSIWYG editor the text appears correctly, but when I press the Code button (CTRL+SHIFT+S) the lines dissappear and is needed add an extra line in every paragraph to solve it. Also if I publish the text without press the Code button anyway appears incorrectly. This is a pic about the problem (also attached):

http://i66.tinypic.com/10zctx2.jpg

In the top is when I paste the text in the WYSIWYG editor, in the middle when I press the Code button, and in the bottom when I press again the button to be back to the WYSIWYG editor.

I have been checking modifying the lines 1826 --> 1844 in the jquery.sceditor.bbcode.min.js file, chaging the "br" and "div" for some "p" or other "br" I got for example that when I press the button 2 times it appears with a line separation, but neither is correct because when there is 2 consecutive lines without separation also appears a line separation, so I not got put it correctly. I think here is the problem:

            for (q = function(a) {
                    return (!a || (a.isHtmlInline !== g ? a.isHtmlInline : a.isInline)) !== !1
                }; b.length > 0;)
                if (j = b.shift()) {
                    if (j.type === n.OPEN) r = j.children[j.children.length - 1] || {}, k = A.bbcodes[j.name], o = d && q(k), l = u(j.children, !1), k && k.html ? (q(k) || !q(A.bbcodes[r.name]) || k.isPreFormatted || k.skipLastLineBreak || i || (l += "<br />"), a.isFunction(k.html) ? m = k.html.call(A, j, j.attrs, l) : (j.attrs[0] = l, m = e.bbcode.formatBBCodeString(k.html, j.attrs))) : m = j.val + l + (j.closing ? j.closing.val : "");
                    else {
                        if (j.type === n.NEWLINE) {
                            if (!d) {
                                s.push("<br />");
                                continue
                            }
                            p || (s.push("<div>"), (h < 8 || c.documentMode && c.documentMode < 8) && s.push(" ")), i || s.push("<br />"), b.length || s.push("<br />"), s.push("</div>\n"), p = !1;
                            continue
                        }
                        o = d, m = f(j.val, !0)
                    }
                    o && !p ? (s.push("<div>"), p = !0) : !o && p && (s.push("</div>\n"), p = !1), s.push(m)
                }
            return p && s.push("</div>\n"), s.join("")

I'm using PHPBB v3.2.2 forum.

Anyway thanks for the mod. I will be waiting the answer =)

code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant