Skip to content

Instantly share code, notes, and snippets.

@G33kDude
Created February 2, 2015 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save G33kDude/042bbad2c4f33860f291 to your computer and use it in GitHub Desktop.
Save G33kDude/042bbad2c4f33860f291 to your computer and use it in GitHub Desktop.
^d::
Code := Clipboard ;"<div style='overflow:scroll; width: 100%; height: 100%; margin: none;'>" Clipboard "</div>"
Code := RegExReplace(Code, "s)\[list\](.*?)\[/list\]", "<ul>$1</ul>")
Code := RegExReplace(Code, "\[\*\](.*)", "<li>$1</li>")
Code := RegExReplace(Code, "\[quote(?:=""([^""]*)"")?\]", "<div class='author'>&nbsp;$1</div><div class='quote'>")
Code := RegExReplace(Code, "\[/quote\]", "</div>")
Code := RegExReplace(Code, "s)\[code[^\]]*\](.*?)\[/code\]", "<pre>$1</pre>")
Code := RegExReplace(Code, "\[c\](.*?)\[/c\]", "<code>$1</code>")
Code := RegExReplace(Code, "\[([^\]]*)\]", "<$1>")
Code := RegExReplace(Code, "\R", "<br/>")
Page =
(
<!DOCTYPE html>
<html>
<head>
<style>
html, body { margin: 0; padding: 0; width: 100`%; height: 100`%; background-color: #DCE1E5;}
html { overflow: scroll; }
body { padding: 50px; width: auto; font-family: Sans-Serif; font-size: 10pt; }
code, pre { background-color: white; border: 1px solid; font-family: Consolas; }
code { color: #115098; font-size: 9pt; border-color: #C9D2D8; }
pre { border-color: #A9B8C2; border-top-width: 2em; border-bottom-width: 2em; padding: 0.5em; }
.author { background-color: #A9B8C2; margin: 0; padding: 0.5em; }
.quote { background-color: white; border: 1px solid; border-color: #A9B8C2; padding: 0.5em; }
</style>
</head>
<body>
%Code%
</body>
</html>
)
Gui, -Caption
Gui, Margin, 0, 0
Gui, Add, ActiveX, vwb w800 h600, mshtml:
wb.Write(Page)
Gui, Show
KeyWait, d
Gui, Destroy
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment