mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +00:00
All fixes seem to be working?
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ config/local.*
|
||||
|
||||
todo.md
|
||||
startDB.bat
|
||||
startMViewer.bat
|
||||
|
||||
@@ -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{
|
||||
|
||||
20
package.json
20
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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,59 @@ renderer.html = function (html) {
|
||||
let closeTag = '';
|
||||
html = html.substring(html.indexOf('>')+1);
|
||||
if(_.endsWith(_.trim(html), '</div>')){
|
||||
closeTag = '</div>'
|
||||
closeTag = '</div>';
|
||||
html = html.substring(0,html.lastIndexOf('</div'));
|
||||
}
|
||||
return `${openTag} ${Markdown(html)} ${closeTag}`;
|
||||
}
|
||||
|
||||
// Below may work better if we just explicitly allow <script, <pre and <style
|
||||
// tags to return directly
|
||||
/*if(_.startsWith(_.trim(html), '<script')){
|
||||
return html;
|
||||
}*/
|
||||
|
||||
// Allow raw HTML tags to end without a blank line if markdown is right after
|
||||
if(html.includes('\n')){
|
||||
let openTag = html.substring(0, html.indexOf('>')+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 '<pre><code>\n</code></pre>';
|
||||
}
|
||||
return code;
|
||||
}*/
|
||||
|
||||
const sanatizeScriptTags = (content)=>{
|
||||
return content
|
||||
.replace(/<script/ig, '<script')
|
||||
|
||||
Reference in New Issue
Block a user