Ask Your Question
4

Blockquote problem - wmd js editor

asked 2012-06-23 17:45:30 -0600

alexandros.z gravatar image

updated 2012-06-23 18:03:24 -0600

Evgeny gravatar image

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?

edit retag flag offensive close merge delete

Comments

I do confirm the bug.

naavi gravatar imagenaavi ( 2012-06-24 13:41:06 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2012-08-22 12:32:06 -0600

dajafa gravatar image

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*$)/, "");
edit flag offensive delete link more

Comments

Thank you! Applied this patch to the master branch.

Evgeny gravatar imageEvgeny ( 2012-08-23 07:23:43 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2012-06-23 17:45:30 -0600

Seen: 163 times

Last updated: Aug 22 '12