diff options
author | dx <aryadevchavali1@gmail.com> | 2020-05-23 21:12:04 +0100 |
---|---|---|
committer | dx <aryadevchavali1@gmail.com> | 2020-05-23 21:13:37 +0100 |
commit | 6afdaed5f4f371017447afc3ca1922393ce12c79 (patch) | |
tree | 84f07f931091b07929fe5b61d2e684fe935c9ec4 /Compiler/src | |
parent | 758147528057c7ff8d65ef3435065bce2072ecc1 (diff) | |
download | mdhtml-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/src')
-rw-r--r-- | Compiler/src/compiler.cpp | 2 |
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; |