Compare commits

..

No commits in common. "2cc0fa67c598232b94e1d7ac303003beff19eab4" and "cd4911519a689bb887c864a33e83c7a2387e3876" have entirely different histories.

3 changed files with 17 additions and 21 deletions

View file

@ -4,15 +4,11 @@ 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](https://git.luca0n.com/luca0N/luca0N-website).
This utility was created originally for the development of version 3 of the
luca0N! website.
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!
Static Website Generator is very limited and is not intended for anything other
than simple static websites. Some features are still in the works.
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
@ -22,3 +18,7 @@ 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-2023 luca0N!
* Copyright (C) 2022 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-2023"
#define PROGRAM_COPYRIGHT_YEARS "2022"
#define RETURN_SUCCESSFUL 0

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2023 luca0N!
* Copyright (C) 2022 luca0N!
*
* This file is part of Static Website Generator (swg).
*
@ -102,10 +102,9 @@ 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] != '-' && buf[0] == '\n') {
if (tag_ul && newline && buf[0] != '-') {
tag_ul = false;
tag_li = false;
html += "</li></ul>";
html += "</ul>";
}
// Read character by character
@ -130,14 +129,15 @@ std::string make_html(std::filesystem::path const &path) {
html += ">";
tag_h = 0;
}
if (!tag_li)
html += '\n';
if (tag_li) html += "</li>", tag_li = false;
html += '\n';
break;
}
// Start paragraph if newline and no
// special characters were matched.
if (!tag_comment && !tag_ul && (!tag_p && newline && x == 0 &&
if (!tag_comment && (!tag_p && newline && x == 0 &&
c != '#' && c != '-'))
html += "<p>",
tag_p = true;
@ -261,10 +261,6 @@ 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;