Compare commits

...

5 commits

Author SHA1 Message Date
2cc0fa67c5
Merge branch 'master' into dev 2023-12-01 08:12:03 -03:00
da4c0b6173
Update copyright year info 2023-09-07 23:48:22 -03:00
947a5ea044
Update README 2023-09-07 23:23:28 -03:00
864b6dafe7
Update copyright year in README 2023-09-07 23:17:04 -03:00
12814571cf
Fix list line break issue (#5)
Fixed an issue which would cause the MarkdownParser to prematurely end a list on a single line break.
2023-09-07 23:10:02 -03:00
3 changed files with 21 additions and 17 deletions

View file

@ -4,11 +4,15 @@ Static Website Generator (swg) is a lightweight utility that does exactly
what's written on the tin. This utility aims to be a simple yet painless
program to automate the boring work of static website development.
This utility was created originally for the development of version 3 of the
luca0N! website.
This utility was created originally for the [development of version 3 of the
luca0N! website](https://git.luca0n.com/luca0N/luca0N-website).
Static Website Generator is very limited and is not intended for anything other
than simple static websites. Some features are still in the works.
Static Website Generator is currently under development, and production usage
is discouraged. Expect bugs and bad unoptimized performance.
## License and copyright notice
Copyright © 20222023 luca0N!
This is free software. You are allowed to modify, redistribute and distribute
modified versions of this software under the terms of the GNU Lesser General
@ -18,7 +22,3 @@ Inc. [Read the LICENSE file for further information.](LICENSE)
## Documentation
Coming soon!
<hr/>
Copyright © 20222023 luca0N!

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 luca0N!
* Copyright (C) 2022-2023 luca0N!
*
* This file is part of Static Website Generator (swg).
*
@ -25,7 +25,7 @@
#define PROGRAM_VERSION 1
#define PROGRAM_VERSION_NAME "0.1-dev"
#define PROGRAM_COPYRIGHT "luca0N!"
#define PROGRAM_COPYRIGHT_YEARS "2022"
#define PROGRAM_COPYRIGHT_YEARS "2022-2023"
#define RETURN_SUCCESSFUL 0

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 luca0N!
* Copyright (C) 2022-2023 luca0N!
*
* This file is part of Static Website Generator (swg).
*
@ -102,9 +102,10 @@ std::string make_html(std::filesystem::path const &path) {
// End ul tag if it's active and a new line doesn't contain an
// item.
if (tag_ul && newline && buf[0] != '-') {
if (tag_ul && newline && buf[0] != '-' && buf[0] == '\n') {
tag_ul = false;
html += "</ul>";
tag_li = false;
html += "</li></ul>";
}
// Read character by character
@ -129,15 +130,14 @@ std::string make_html(std::filesystem::path const &path) {
html += ">";
tag_h = 0;
}
if (tag_li) html += "</li>", tag_li = false;
html += '\n';
if (!tag_li)
html += '\n';
break;
}
// Start paragraph if newline and no
// special characters were matched.
if (!tag_comment && (!tag_p && newline && x == 0 &&
if (!tag_comment && !tag_ul && (!tag_p && newline && x == 0 &&
c != '#' && c != '-'))
html += "<p>",
tag_p = true;
@ -261,6 +261,10 @@ std::string make_html(std::filesystem::path const &path) {
// Start unordered list tag if it's not active.
if (!tag_ul) html += "<ul>", tag_ul = true;
// End previous list item, if active.
if (tag_li) html += "</li>\n", tag_li = false;
html += "<li>";
ignoreSpace = true;
tag_li = true;