First time here? Check out the FAQ!
4

Blockquote problem - wmd js editor

Hello.

I have noticed (in Chrome 19.0.1084.56 m) that blockquote functionality in wmd editor doesn't work as it should.

This is what is generated:

Blockquote

Blockquote> BlockquoteBlockquote

Blockquote

However, in Mozilla (13.0.1), it works!

Does any of you face similar problems? Do you have any suggestions?

alexandros.z's avatar
596
alexandros.z
asked 2012-06-23 17:45:30 -0600
Evgeny's avatar
13.2k
Evgeny
updated 2012-06-23 18:03:24 -0600
edit flag offensive 0 remove flag close merge delete

Comments

I do confirm the bug.

naavi's avatar naavi (2012-06-24 13:41:06 -0600) edit
add a comment see more comments

1 Answer

3

Find this solution and verified it fixed this issue on Chrome (solution from http://meta.stackoverflow.com/users/159266/dipesh-kc): http://meta.stackoverflow.com/questions/63307/blockquote-glitch-in-editor-in-chrome-6-and-7

We need to fix the file: askbot/skins/common/media/js/wmd/wmd.js

    @@ -21,6 +21,7 @@ Attacklab.wmdBase = function(){


    // Used to work around some browser bugs where we can't use feature testing.
+   global.isChrome = /chrome/.test(nav.userAgent.toLowerCase());
    global.isIE = /msie/.test(nav.userAgent.toLowerCase());
    global.isIE_5or6 = /msie 6/.test(nav.userAgent.toLowerCase()) || /msie 5/.test(nav.userAgent.toLowerCase());
    global.isIE_7plus = global.isIE && !global.isIE_5or6;
@@ -1599,6 +1600,11 @@ util.prompt = function(text, defaultInputText, makeLinkMarkdown, dialogType){
        var regexText;
        var replacementText;

+        // workaround for broken blockquote under Chrome.
+        if (global.isChrome) {
+            "X".match(/()./)
+        }
+
        this.selection = this.selection.replace(/(^\n*)/, "");
        this.startTag = this.startTag + re.$1;
        this.selection = this.selection.replace(/(\n*$)/, "");
dajafa's avatar
41
dajafa
answered 2012-08-22 12:32:06 -0600
edit flag offensive 0 remove flag delete link

Comments

Thank you! Applied this patch to the master branch.

Evgeny's avatar Evgeny (2012-08-23 07:23:43 -0600) edit
add a comment see more comments