mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-10-24 04:07:40 +00:00
Add horizontal bar and formatting to lists
This commit is contained in:
@@ -122,7 +122,7 @@ preformattedState:
|
||||
listState:
|
||||
switch {
|
||||
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("```"):
|
||||
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)))
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Submodule metarrhiza updated: 58d000edaa...2e2e3a70f9
Reference in New Issue
Block a user