From 36f9e5d3756f7be64891373f1b215261c20122b8 Mon Sep 17 00:00:00 2001 From: Steve Klise Date: Fri, 8 Nov 2013 16:11:26 -0500 Subject: [PATCH] Preliminary regex support --- htmlbook.js | 17 +++++++++++++++++ package.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/htmlbook.js b/htmlbook.js index 6e26b77..bcdae11 100644 --- a/htmlbook.js +++ b/htmlbook.js @@ -15,6 +15,23 @@ marked.setOptions({ tables: true }); +var def_marked = function (input) { + md = marked(input); + + def_list_regex = /(((: .+\n)+((= | ).*\n)*)(?:\n*))+/gi + + // : Apple + // = Pomaceous fruit of plants of the genus Malus in + // the family Rosaceae. + // = An American computer company. + + // : Citrus + // : Orange + // = The fruit of an evergreen tree of the genus Citrus. + + console.log(md.match(def_list_regex)) +} + var markdown_headers = ['h1','h2','h3','h4','h5','h6'], htmlbook_headers = ['h1','h1','h2','h3','h4','h5'], heirarchy = ['chapter', 'sect1', 'sect2', 'sect3', 'sect4', 'sect5'], diff --git a/package.json b/package.json index ee25aae..d50ac3a 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "author": "O'Reilly Media", "license": "MIT", "dependencies": { - "marked": "0.2.9", + "marked": "0.2.10", "optparse": "1.0.4", "html": "0.0.7", "underscore": "1.5.2",