diff --git a/changelog.md b/changelog.md index 544cf3896..cbd782e80 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +### Friday, 09/09/2016 - v2.4.0 +- Adding in a HTML validator that will display warnings whenever you save. This should stop a lot of the issues generated with pages not showing up. + ### Saturday, 20/08/2016 - v2.3.0 - Added in a license file - Updated the welcome text diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js deleted file mode 100644 index caa6a2307..000000000 --- a/shared/naturalcrit/markdown.js +++ /dev/null @@ -1,43 +0,0 @@ -var _ = require('lodash'); -var Markdown = require('marked'); -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), '')){ - var openTag = html.substring(0, html.indexOf('>')+1); - html = html.substring(html.indexOf('>')+1); - html = html.substring(0, html.lastIndexOf('')); - return `${openTag} ${Markdown(html)} `; - } - return html; -}; - -module.exports = { - render : (rawText)=>{ - return Markdown(rawText, {renderer : renderer}) - }, - validate : (rawText)=>{ - var errors = []; - var tokens = Markdown.lexer(rawText); - - _.each(tokens, (token)=>{ - if(token.type === 'paragraph'){ - if(_.startsWith(token.text, '')){ - errors.push({ - err : ' No opening tag', - token : token - }) - } - } - }); - - return errors; - }, - marked : Markdown -};