diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/clarktown/correctors.clj | 14 | ||||
| -rw-r--r-- | src/clarktown/correctors/atx_heading_block.clj | 4 | ||||
| -rw-r--r-- | src/clarktown/correctors/fenced_code_block.clj (renamed from src/clarktown/correctors/code_block.clj) | 6 | ||||
| -rw-r--r-- | src/clarktown/correctors/list_block.clj | 4 | ||||
| -rw-r--r-- | src/clarktown/engine.clj | 4 | ||||
| -rw-r--r-- | src/clarktown/matchers/fenced_code_block.clj (renamed from src/clarktown/matchers/code_block.clj) | 4 | ||||
| -rw-r--r-- | src/clarktown/parsers.clj | 14 | ||||
| -rw-r--r-- | src/clarktown/renderers/fenced_code_block.clj (renamed from src/clarktown/renderers/code_block.clj) | 2 |
8 files changed, 26 insertions, 26 deletions
diff --git a/src/clarktown/correctors.clj b/src/clarktown/correctors.clj index 1a61f2d..6b7cc1c 100644 --- a/src/clarktown/correctors.clj +++ b/src/clarktown/correctors.clj @@ -1,6 +1,6 @@ (ns clarktown.correctors (:require - [clarktown.correctors.code-block :as code-block] + [clarktown.correctors.fenced-code-block :as fenced-code-block] [clarktown.correctors.atx-heading-block :as atx-heading-block] [clarktown.correctors.list-block :as list-block])) @@ -9,13 +9,13 @@ ^{:doc "The default block separation correctors."} default-block-separation-correctors {:newline-above - [code-block/empty-line-above? - atx-heading-block/empty-line-above? - list-block/empty-line-above?] + [fenced-code-block/newline-above? + atx-heading-block/newline-above? + list-block/newline-above?] :newline-below - [code-block/empty-line-below? - atx-heading-block/empty-line-below? - list-block/empty-line-below?]}) + [fenced-code-block/newline-below? + atx-heading-block/newline-below? + list-block/newline-below?]}) (def diff --git a/src/clarktown/correctors/atx_heading_block.clj b/src/clarktown/correctors/atx_heading_block.clj index a2a948b..6668700 100644 --- a/src/clarktown/correctors/atx_heading_block.clj +++ b/src/clarktown/correctors/atx_heading_block.clj @@ -13,7 +13,7 @@ odd?)) -(defn empty-line-above? +(defn newline-above? "Determines whether there's a need for an empty new line above the `line` at the current `index`. In the case of a ATX heading block that starts with the `#` character, if @@ -27,7 +27,7 @@ (not (in-code-block? lines index)))) -(defn empty-line-below? +(defn newline-below? "Determines whether there's a need for an empty new line below the `line` at the current `index`. In the case of a ATX heading block that starts with the `#` character, if diff --git a/src/clarktown/correctors/code_block.clj b/src/clarktown/correctors/fenced_code_block.clj index 73989fe..77bc023 100644 --- a/src/clarktown/correctors/code_block.clj +++ b/src/clarktown/correctors/fenced_code_block.clj @@ -1,9 +1,9 @@ -(ns clarktown.correctors.code-block +(ns clarktown.correctors.fenced-code-block (:require [clojure.string :as string])) -(defn empty-line-above? +(defn newline-above? "Determines whether there's a need for an empty new line above the `line` at the current `index`. In the case of a code block, which starts with three backticks (```), if there's @@ -20,7 +20,7 @@ string/trim) "")))) -(defn empty-line-below? +(defn newline-below? "Determines whether there's a need for an empty new line below the `line` at the current `index`. In the case of a code block, which ends with three backticks (```), if there's diff --git a/src/clarktown/correctors/list_block.clj b/src/clarktown/correctors/list_block.clj index cf84bb1..4525ff7 100644 --- a/src/clarktown/correctors/list_block.clj +++ b/src/clarktown/correctors/list_block.clj @@ -4,7 +4,7 @@ [clarktown.matchers.list-block :as matcher])) -(defn empty-line-above? +(defn newline-above? "Determines whether there's a need for an empty new line above the `line` at the current `index`. In the list block case that's when the above line is not a newline and is not @@ -20,7 +20,7 @@ "")))) -(defn empty-line-below? +(defn newline-below? "Determines whether there's a need for an empty new line above the `line` at the current `index`. In the list block case that's when the below line is not a newline and is not diff --git a/src/clarktown/engine.clj b/src/clarktown/engine.clj index eaa0fb0..5eb22d5 100644 --- a/src/clarktown/engine.clj +++ b/src/clarktown/engine.clj @@ -3,7 +3,7 @@ [clojure.string :as string])) -(defn- stitch-code-blocks +(defn- stitch-fenced-code-blocks "Since code blocks can span multiple blocks (a block is separated by two line breaks from another block) , we need to stitch them together into one block in order for a block parser to be able to do anything @@ -144,6 +144,6 @@ [markdown given-parsers given-correctors] (let [blocks (-> (correct-markdown markdown given-correctors) (string/split #"\n\n") - stitch-code-blocks) + stitch-fenced-code-blocks) parsed-blocks (parse-blocks blocks given-parsers given-correctors)] (string/join "\n\n" parsed-blocks))) diff --git a/src/clarktown/matchers/code_block.clj b/src/clarktown/matchers/fenced_code_block.clj index 655c951..9bbcdca 100644 --- a/src/clarktown/matchers/code_block.clj +++ b/src/clarktown/matchers/fenced_code_block.clj @@ -1,4 +1,4 @@ -(ns clarktown.matchers.code-block +(ns clarktown.matchers.fenced-code-block (:require [clojure.string :as string])) @@ -7,4 +7,4 @@ "Determines whether we're dealing with a code block." [block] (and (string/starts-with? block "```") - (string/ends-with? block "```")))
\ No newline at end of file + (string/ends-with? block "```"))) diff --git a/src/clarktown/parsers.clj b/src/clarktown/parsers.clj index 77c9794..0d3b019 100644 --- a/src/clarktown/parsers.clj +++ b/src/clarktown/parsers.clj @@ -8,8 +8,8 @@ [clarktown.renderers.heading-block] [clarktown.matchers.quote-block] [clarktown.renderers.quote-block] - [clarktown.matchers.code-block] - [clarktown.renderers.code-block] + [clarktown.matchers.fenced-code-block] + [clarktown.renderers.fenced-code-block] [clarktown.matchers.list-block] [clarktown.renderers.list-block] [clarktown.renderers.paragraph-block] @@ -54,10 +54,10 @@ (def - ^{:doc "Detects, parses and renders a code block."} - code-block-parser - {:matcher clarktown.matchers.code-block/match? - :renderers [clarktown.renderers.code-block/render]}) + ^{:doc "Detects, parses and renders a fenced code block."} + fenced-code-block-parser + {:matcher clarktown.matchers.fenced-code-block/match? + :renderers [clarktown.renderers.fenced-code-block/render]}) (def @@ -90,6 +90,6 @@ horizontal-line-block-parser heading-block-parser quote-block-parser - code-block-parser + fenced-code-block-parser list-block-parser paragraph-block-parser]) diff --git a/src/clarktown/renderers/code_block.clj b/src/clarktown/renderers/fenced_code_block.clj index 184e90e..905c061 100644 --- a/src/clarktown/renderers/code_block.clj +++ b/src/clarktown/renderers/fenced_code_block.clj @@ -1,4 +1,4 @@ -(ns clarktown.renderers.code-block +(ns clarktown.renderers.fenced-code-block (:require [clojure.string :as string])) |
