// ==UserScript== // @name MarkDown stealer // @namespace HTLAL // @include http://how-to-learn-any-language.com/forum/* // @version 1 // @grant none // ==/UserScript== // basic markdown reg expressions var mdpat = [/\*\*(.*?)\*\*/g, /\*(.*?)\*/g, /_(.*?)_/g, /\[(.*?)\]\((.*?)\)/g, /\[([http|ftp].*?)\]/g]; // replacements for the preview window var mdrep = ['$1', '$1', '$1', '$1', '$1']; // to convert the markdown to BBCode var bbcode = ['[B]$1[/B]', '[I]$1[/I]', '[U]$1[/U]', '[URL=$2]$1[/URL]', '[URL]$1[/URL]']; previewPageHTML = ' ' + ' ' + ' Post Preview' + ' ' + ' ' + '
Post Preview
' + '
'; previewPageHTML_bottom = '
' + '
Close Window
' + '' + ''; function convertMarkDown(e) { // e.preventDefault(); var textareas = document.getElementsByTagName('textarea'); // grab the textarea element if (textareas) { var textarea = textareas[0]; text = textarea.value; text = text.replace(/(?:\r\n|\r|\n)/g, '
'); // replace all new lines for BR for(i=0;i'); // replace all new lines for BR for(i=0;i