aboutsummaryrefslogtreecommitdiff
path: root/Compiler
diff options
context:
space:
mode:
authordx <aryadevchavali1@gmail.com>2020-05-23 21:12:04 +0100
committerdx <aryadevchavali1@gmail.com>2020-05-23 21:13:37 +0100
commit6afdaed5f4f371017447afc3ca1922393ce12c79 (patch)
tree84f07f931091b07929fe5b61d2e684fe935c9ec4 /Compiler
parent758147528057c7ff8d65ef3435065bce2072ecc1 (diff)
downloadmdhtml-6afdaed5f4f371017447afc3ca1922393ce12c79.tar.gz
mdhtml-6afdaed5f4f371017447afc3ca1922393ce12c79.tar.bz2
mdhtml-6afdaed5f4f371017447afc3ca1922393ce12c79.zip
~boundary condition for depth checker in heading
If the headings are greater than 6, then stop increasing. h6 is the smallest heading tag possible.
Diffstat (limited to 'Compiler')
-rw-r--r--Compiler/src/compiler.cpp2
1 files changed, 1 insertions, 1 deletions
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, "<h%d>%s</h%d>", depth, raw + depth, depth);
return r;