Fix url encoding
This commit is contained in:
		
				
					committed by
					
						
						Arsen Melikyan
					
				
			
			
				
	
			
			
			
						parent
						
							db57fd405f
						
					
				
				
					commit
					e1aec710aa
				
			@@ -46,27 +46,27 @@ window.common = (function(global) {
 | 
				
			|||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case common.challengeTypes.JS:
 | 
					        case common.challengeTypes.JS:
 | 
				
			||||||
        case common.challengeTypes.BONFIRE:
 | 
					        case common.challengeTypes.BONFIRE:
 | 
				
			||||||
          type = 'javascript';
 | 
					          type = 'js';
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
          type = '';
 | 
					          type = '';
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var returnValue = '';
 | 
					      var returnValue = '';
 | 
				
			||||||
      if (trigger.id === 'markdown') {
 | 
					      switch (trigger.id) {
 | 
				
			||||||
 | 
					        case 'markdown':
 | 
				
			||||||
          returnValue = '```' + type + '\n' + editor.getSelection() + '\n```';
 | 
					          returnValue = '```' + type + '\n' + editor.getSelection() + '\n```';
 | 
				
			||||||
          editor.replaceSelection(editor.getSelection());
 | 
					          editor.replaceSelection(editor.getSelection());
 | 
				
			||||||
          return returnValue;
 | 
					          return returnValue;
 | 
				
			||||||
      } else if (trigger.id === 'plain') {
 | 
					        case 'plain':
 | 
				
			||||||
          returnValue = editor.getSelection();
 | 
					          returnValue = editor.getSelection();
 | 
				
			||||||
          editor.replaceSelection(editor.getSelection());
 | 
					          editor.replaceSelection(editor.getSelection());
 | 
				
			||||||
          return returnValue;
 | 
					          return returnValue;
 | 
				
			||||||
      } else if (trigger.id === 'link') {
 | 
					        case 'link':
 | 
				
			||||||
          editor.replaceSelection(editor.getSelection());
 | 
					          editor.replaceSelection(editor.getSelection());
 | 
				
			||||||
        return ('[Challenge - ' + common.challengeName +
 | 
					          return '[Challenge - ' + common.challengeName +
 | 
				
			||||||
          (common.username ? ' (' + common.username + '\'s solution)' : '')
 | 
					          (common.username ? ' (' + common.username + '\'s solution)' : '')
 | 
				
			||||||
        + '](' + window.location + ')')
 | 
					          + '](' + String(window.location).replace(/\)/g, '%29') + ')';
 | 
				
			||||||
        .replace(/\)/g, '%29').replace(/%29\]/g, ')]') + ')';
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user