From 6afdaed5f4f371017447afc3ca1922393ce12c79 Mon Sep 17 00:00:00 2001 From: dx Date: Sat, 23 May 2020 21:12:04 +0100 Subject: ~boundary condition for depth checker in heading If the headings are greater than 6, then stop increasing. h6 is the smallest heading tag possible. --- Compiler/src/compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Compiler/src') diff --git a/Compiler/src/compiler.cpp b/Compiler/src/compiler.cpp index 89d06cd..1220457 100644 --- a/Compiler/src/compiler.cpp +++ b/Compiler/src/compiler.cpp @@ -20,7 +20,7 @@ std::string compile_line(const char *raw) { // Get depth of header int depth; - for (depth = 0; (*(raw + depth)) == '#'; ++depth); + for (depth = 0; (*(raw + depth)) == '#' && depth < 7; ++depth); asprintf(&r, "%s", depth, raw + depth, depth); return r; -- cgit v1.2.3-13-gbd6f