From 2aa657fe9e9cc818ffd0e6f2db43b2bf629f1215 Mon Sep 17 00:00:00 2001 From: Mike Kamermans Date: Fri, 14 Apr 2017 08:29:58 -0700 Subject: [PATCH] Update chunk.js --- tools/lib/chunk.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/lib/chunk.js b/tools/lib/chunk.js index e59c3e0a..b9d5b0f9 100644 --- a/tools/lib/chunk.js +++ b/tools/lib/chunk.js @@ -1,7 +1,21 @@ /** - * fix the stupid nonsense inability for markdown parsers to see link - * syntax with `)` in the links themselves. + * + * This file defines all the chunking functions that can be used to take + * a source markdown file, and then chop it up into blocks that should + * either be converted as markdown, or should be left alone. + * + * Getting a final HTML file using this entirely not-optimized solution + * simply involves calling: + * + * const convert = require(some markdown converter) + * const chunk = require(this file) + * const html = chunk(markdown).map(c => c.convert ? convert(c.data) : c.data).join('\n') + * + * And you're done. + * */ +// fix the stupid nonsense inability for markdown parsers to see link +// syntax with `)` in the links themselves function fixMarkDownLinks(data, chunks, chunkMore) { var next = chunkMore ? chunkMore[0] : false, otherChunkers = chunkMore ? chunkMore.slice(1) : false,