commit 682e57c913c1cf04de33a1a056ae4b396faf7e01 parent 3f6916200789da0768d3adccc15601efd872f4ba Author: Andrew Laack <andrew@laack.co> Date: Sun, 6 Sep 2026 10:37:52 -0500 updated header levels Diffstat:
| M | learning/lib/parser.ml | | | 17 | +++++++---------- |
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/learning/lib/parser.ml b/learning/lib/parser.ml @@ -56,18 +56,15 @@ let is_embedded_link line preformatted = let is_link line preformatted = ((not preformatted) && Shared.match_on_prefix line "=> ") -let header_count line preformatted = - let count = Basic_functions.count_prefix '#' line in - if (not preformatted) && String.length line > count && line.[count] = ' ' then - count - else 0 - let is_h1 line preformatted = - header_count line preformatted - = 1 (* TODO: Make this more consistent with the others *) + ((not preformatted) && Shared.match_on_prefix line "# ") + +let is_h2 line preformatted = + ((not preformatted) && Shared.match_on_prefix line "## ") + +let is_h3 line preformatted = + ((not preformatted) && Shared.match_on_prefix line "### ") -let is_h2 line preformatted = header_count line preformatted = 2 -let is_h3 line preformatted = header_count line preformatted = 3 let is_preformatted _ preformatted = preformatted let get_line_type line preformatted =