diff --git a/markup/lexer.go b/markup/lexer.go index d71e497..2f1d3fc 100644 --- a/markup/lexer.go +++ b/markup/lexer.go @@ -107,6 +107,8 @@ func geminiLineToAST(line string, state *GemLexerState, ast *[]Line) { goto preformattedState case "list": goto listState + case "number": + goto numberState default: goto normalState } @@ -146,6 +148,22 @@ listState: } return +numberState: + switch { + case startsWith("*. "): + state.buf += fmt.Sprintf("\t
  • %s
  • \n", ParagraphToHtml(line[2:])) + case startsWith("```"): + state.where = "pre" + addLine(state.buf + "") + state.id++ + state.buf = fmt.Sprintf("
    ", state.id, strings.TrimPrefix(line, "```"))
    +	default:
    +		state.where = ""
    +		addLine(state.buf + "")
    +		goto normalState
    +	}
    +	return
    +
     normalState:
     	state.id++
     	switch {
    @@ -157,6 +175,10 @@ normalState:
     		state.where = "list"
     		state.buf = fmt.Sprintf("