From 5bc948ab0ada3e565430c8ce11857b31131d290a Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 25 Mar 2020 12:09:50 -0400 Subject: [PATCH] All fixes seem to be working? --- .gitignore | 1 + client/homebrew/phbStyle/phb.style.less | 11 ++++-- package.json | 20 +++++------ shared/naturalcrit/markdown.js | 48 ++++++++++++++++++++++++- 4 files changed, 66 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 5c4a9c534..fcedd6d4f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ config/local.* todo.md startDB.bat +startMViewer.bat diff --git a/client/homebrew/phbStyle/phb.style.less b/client/homebrew/phbStyle/phb.style.less index eea74771e..3b10b0aee 100644 --- a/client/homebrew/phbStyle/phb.style.less +++ b/client/homebrew/phbStyle/phb.style.less @@ -177,6 +177,12 @@ body { } } //***************************** + // * SPLIT TABLE + // *****************************/ + div table+pre { + display: none; + } + //***************************** // * NOTE // *****************************/ blockquote{ @@ -330,9 +336,8 @@ body { //Column Break pre, code{ visibility : hidden; - -webkit-column-break-after : always; - break-after : always; - -moz-column-break-after : always; + break-after : column; + min-height : 1px; } //Avoid breaking up p,blockquote,table{ diff --git a/package.json b/package.json index 1ae37cc63..a3eeda545 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "homebrewery", "description": "Create authentic looking D&D homebrews using only markdown", - "version": "2.8.1", + "version": "2.8.2", "repository": { "type": "git", - "url": "git://github.com/stolksdorf/homebrewery.git" + "url": "git://github.com/naturalcrit/homebrewery.git" }, "scripts": { "dev": "node scripts/dev.js", @@ -36,30 +36,30 @@ ] }, "dependencies": { - "babel-preset-env": "^1.1.8", + "babel-preset-env": "^1.7.0", "babel-preset-react": "^6.24.1", "body-parser": "^1.19.0", "classnames": "^2.2.6", - "codemirror": "^5.51.0", + "codemirror": "^5.52.0", "cookie-parser": "^1.4.4", "create-react-class": "^15.6.3", "express": "^4.17.1", "jwt-simple": "^0.5.6", "lodash": "^4.17.15", - "marked": "^0.8.0", + "marked": "^0.8.2", "moment": "^2.24.0", - "mongoose": "^5.7.5", + "mongoose": "^5.9.2", "nconf": "^0.10.0", "pico-router": "^2.1.0", - "react": "^16.12.0", - "react-dom": "^16.12.0", + "react": "^16.13.0", + "react-dom": "^16.13.0", "shortid": "^2.2.15", - "superagent": "^5.2.1", + "superagent": "^5.2.2", "vitreum": "^4.10.1" }, "devDependencies": { "eslint": "^6.8.0", - "eslint-plugin-react": "^7.18.3", + "eslint-plugin-react": "^7.19.0", "pico-check": "^1.3.2" } } diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 1621f7384..0dd97978c 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -9,13 +9,59 @@ renderer.html = function (html) { let closeTag = ''; html = html.substring(html.indexOf('>')+1); if(_.endsWith(_.trim(html), '')){ - closeTag = '' + closeTag = ''; + html = html.substring(0,html.lastIndexOf('')+1); + if(!_.endsWith(_.trim(html), '>')){ // If there is no closing tag, parse markdown directly after + let remainder = html.substring(html.indexOf('>')+1); + return `${openTag} ${Markdown(remainder)}`; + } + } + + /*if(html.includes('\n')){ + //let openTag = html.substring(0, html.indexOf('\n')); + let openTag = html.substring(0, html.indexOf('>')+1); + console.log("FULL HTML"); + console.log(html); + console.log("OPEN TAG"); + console.log(openTag); + + let closeTag = ''; + if(_.endsWith(_.trim(html), '>')){ + closeTag = html.substring(html.lastIndexOf('<')); + console.log("CLOSETAG"); + console.log(closeTag); + } + else { + let remainder = html.substring(html.indexOf('>')+1); + console.log("REMAINDER"); + console.log(remainder); + return `${openTag} ${Markdown(remainder)}`; + } + }*/ + return html; }; +/*renderer.code = function (code, infostring, escaped) { + if(code == ''){ + return '
\n
'; + } + return code; +}*/ + const sanatizeScriptTags = (content)=>{ return content .replace(/