Add initial <ul> list support
Added initial support for unordered lists. This update adds <li> tags, but doesn't add <ul> tags.
This commit is contained in:
parent
81b523d312
commit
58710d07c5
|
@ -41,6 +41,7 @@ std::string make_html(std::filesystem::path const &path) {
|
|||
bool tag_b = false,
|
||||
tag_i = false,
|
||||
tag_p = false,
|
||||
tag_li = false,
|
||||
// If there is an escape character at the end of the buffer, use
|
||||
// this flag to prevent ignoring it.
|
||||
escaping = false,
|
||||
|
@ -78,13 +79,15 @@ std::string make_html(std::filesystem::path const &path) {
|
|||
html += ">";
|
||||
tag_h = 0;
|
||||
}
|
||||
if (tag_li) html += "</li>", tag_li = false;
|
||||
html += '\n';
|
||||
break;
|
||||
}
|
||||
// Start paragraph if newline and no
|
||||
// special characters were matched.
|
||||
|
||||
if (!tag_p && newline && x == 0 && c != '#')
|
||||
if (!tag_p && newline && x == 0 &&
|
||||
c != '#' && c != '-')
|
||||
html += "<p>",
|
||||
tag_p = true;
|
||||
|
||||
|
@ -167,6 +170,16 @@ std::string make_html(std::filesystem::path const &path) {
|
|||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case '-':
|
||||
if (x != 0) {
|
||||
html += c;
|
||||
break;
|
||||
}
|
||||
|
||||
html += "<li>";
|
||||
ignoreSpace = true;
|
||||
tag_li = true;
|
||||
break;
|
||||
case ' ':
|
||||
if (ignoreSpace) {
|
||||
|
|
Loading…
Reference in New Issue