mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-10-14 15:27:41 +00:00
Add horizontal bar and formatting to lists
This commit is contained in:
@@ -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)
|
||||||
|
Submodule metarrhiza updated: 58d000edaa...2e2e3a70f9
Reference in New Issue
Block a user