0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Improved the html parsing slightly

This commit is contained in:
Scott Tolksdorf
2016-08-20 12:44:39 -04:00
parent 90c695c005
commit 019383ebdd
3 changed files with 7 additions and 1 deletions

View File

@@ -5,6 +5,8 @@
- Updated the welcome text
- Added in a much better Error page
- If you visit a deleted brew, it will now remove it from your recent list. (Thanks u/sIllverback!)
- Improved parsing of embedded html text in brews. (Thanks u/com-charizard!)
-
### Friday, 29/07/2016 - v2.2.7
- Adding in descriptive note blocks. (Thanks calculuschild!)

View File

@@ -52,6 +52,10 @@ var EditPage = React.createClass({
},
savedBrew : null,
test : ()=>{
},
componentDidMount: function(){
console.log('getting here');

View File

@@ -4,7 +4,7 @@ var renderer = new Markdown.Renderer();
//Processes the markdown within an HTML block if it's just a class-wrapper
renderer.html = function (html) {
if(_.startsWith(_.trim(html), '<div class=') && _.endsWith(_.trim(html), '</div>')){
if(_.startsWith(_.trim(html), '<div') && _.endsWith(_.trim(html), '</div>')){
var openTag = html.substring(0, html.indexOf('>')+1);
html = html.substring(html.indexOf('>')+1);
html = html.substring(0, html.lastIndexOf('</div>'));