mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-03-04 18:48:19 +00:00
Add horizontal bar and formatting to lists
This commit is contained in:
parent
cb52d95882
commit
9ad22b5cf8
@ -122,7 +122,7 @@ preformattedState:
|
|||||||
listState:
|
listState:
|
||||||
switch {
|
switch {
|
||||||
case startsWith("* "):
|
case startsWith("* "):
|
||||||
state.buf += fmt.Sprintf("\t<li>%s</li>\n", remover("*")(line))
|
state.buf += fmt.Sprintf("\t<li>%s</li>\n", ParagraphToHtml(line[2:]))
|
||||||
case startsWith("```"):
|
case startsWith("```"):
|
||||||
state.where = "pre"
|
state.where = "pre"
|
||||||
addLine(state.buf + "</ul>")
|
addLine(state.buf + "</ul>")
|
||||||
@ -176,6 +176,8 @@ normalState:
|
|||||||
|
|
||||||
case startsWith("<="):
|
case startsWith("<="):
|
||||||
addLine(parseTransclusion(line, state.name))
|
addLine(parseTransclusion(line, state.name))
|
||||||
|
case line == "----":
|
||||||
|
*ast = append(*ast, Line{id: -1, contents: "<hr/>"})
|
||||||
default:
|
default:
|
||||||
addLine(fmt.Sprintf("<p id='%d'>%s</p>", state.id, ParagraphToHtml(line)))
|
addLine(fmt.Sprintf("<p id='%d'>%s</p>", state.id, ParagraphToHtml(line)))
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ func Parse(ast []Line, from, to int, state GemParserState) (html string) {
|
|||||||
return "Transclusion depth limit"
|
return "Transclusion depth limit"
|
||||||
}
|
}
|
||||||
for _, line := range ast {
|
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) {
|
switch v := line.contents.(type) {
|
||||||
case Transclusion:
|
case Transclusion:
|
||||||
html += Transclude(v, state)
|
html += Transclude(v, state)
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 58d000edaa4f06586accc6199190ca69bebf2ad4
|
Subproject commit 2e2e3a70f9de67b54f912dd9fdaa04497bf795b0
|
Loading…
x
Reference in New Issue
Block a user