summaryrefslogtreecommitdiffstats
path: root/packages/markdown/marked/test/browser/test.js
diff options
context:
space:
mode:
authorThiago Fernando <thiagofernando@outlook.com>2019-05-10 14:54:25 -0300
committerGitHub <noreply@github.com>2019-05-10 14:54:25 -0300
commitce0473480bab3fc621d4baecfff0f413e21b5e2c (patch)
tree06d724b4f80885bdd13137f7977d7a914cca0138 /packages/markdown/marked/test/browser/test.js
parentc43508cacbd64357409a3de114db9dab2ae59a9d (diff)
parent7ff4067e88ed59686c86d81447fa2ce550032034 (diff)
downloadwekan-ce0473480bab3fc621d4baecfff0f413e21b5e2c.tar.gz
wekan-ce0473480bab3fc621d4baecfff0f413e21b5e2c.tar.bz2
wekan-ce0473480bab3fc621d4baecfff0f413e21b5e2c.zip
Merge pull request #1 from wekan/devel
ldap changes
Diffstat (limited to 'packages/markdown/marked/test/browser/test.js')
-rw-r--r--packages/markdown/marked/test/browser/test.js66
1 files changed, 66 insertions, 0 deletions
diff --git a/packages/markdown/marked/test/browser/test.js b/packages/markdown/marked/test/browser/test.js
new file mode 100644
index 00000000..59917dd4
--- /dev/null
+++ b/packages/markdown/marked/test/browser/test.js
@@ -0,0 +1,66 @@
+
+;(function() {
+ var console = {},
+ files = __TESTS__; // eslint-disable-line no-undef
+
+ console.log = function(text) {
+ var args = Array.prototype.slice.call(arguments, 1),
+ i = 0;
+
+ text = text.replace(/%\w/g, function() {
+ return args[i++] || '';
+ });
+
+ if (window.console) window.console.log(text);
+ document.body.innerHTML += '<pre>' + escape(text) + '</pre>';
+ };
+
+ if (!Object.keys) {
+ Object.keys = function(obj) {
+ var out = [],
+ key;
+
+ for (key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ out.push(key);
+ }
+ }
+
+ return out;
+ };
+ }
+
+ if (!Array.prototype.forEach) {
+ // eslint-disable-next-line no-extend-native
+ Array.prototype.forEach = function(callback, context) {
+ for (var i = 0; i < this.length; i++) {
+ callback.call(context || null, this[i], i, this);
+ }
+ };
+ }
+
+ if (!String.prototype.trim) {
+ // eslint-disable-next-line no-extend-native
+ String.prototype.trim = function() {
+ return this.replace(/^\s+|\s+$/g, '');
+ };
+ }
+
+ // eslint-disable-next-line no-unused-vars
+ function load() {
+ return files;
+ }
+
+ function escape(html, encode) {
+ return html
+ .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/"/g, '&quot;')
+ .replace(/'/g, '&#39;');
+ }
+
+ __LIBS__; // eslint-disable-line no-undef, no-unused-expressions
+
+ (__MAIN__)(); // eslint-disable-line no-undef
+}).call(this);