1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-13 05:50:27 +00:00

Add horizontal bar and formatting to lists

This commit is contained in:
bouncepaw 2020-11-03 17:27:26 +05:00
parent cb52d95882
commit 9ad22b5cf8
3 changed files with 6 additions and 4 deletions

View File

@ -121,8 +121,8 @@ preformattedState:
listState:
switch {
case startsWith("*"):
state.buf += fmt.Sprintf("\t<li>%s</li>\n", remover("*")(line))
case startsWith("* "):
state.buf += fmt.Sprintf("\t<li>%s</li>\n", ParagraphToHtml(line[2:]))
case startsWith("```"):
state.where = "pre"
addLine(state.buf + "</ul>")
@ -176,6 +176,8 @@ normalState:
case startsWith("<="):
addLine(parseTransclusion(line, state.name))
case line == "----":
*ast = append(*ast, Line{id: -1, contents: "<hr/>"})
default:
addLine(fmt.Sprintf("<p id='%d'>%s</p>", state.id, ParagraphToHtml(line)))
}

View File

@ -13,7 +13,7 @@ func Parse(ast []Line, from, to int, state GemParserState) (html string) {
return "Transclusion depth limit"
}
for _, line := range ast {
if line.id >= from && (line.id <= to || to == 0) {
if line.id >= from && (line.id <= to || to == 0) || line.id == -1 {
switch v := line.contents.(type) {
case Transclusion:
html += Transclude(v, state)

@ -1 +1 @@
Subproject commit 58d000edaa4f06586accc6199190ca69bebf2ad4
Subproject commit 2e2e3a70f9de67b54f912dd9fdaa04497bf795b0