tweak comments; add todo.md
This commit is contained in:
parent
2366615cad
commit
904c88f346
11
block.go
11
block.go
|
@ -491,11 +491,16 @@ func (p *Markdown) htmlHr(data []byte, doRender bool) int {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (p *Markdown) htmlFindTag(data []byte) (string, bool) {
|
||||
i := 0
|
||||
for i < len(data) && isalnum(data[i]) {
|
||||
func skipAlnum(data []byte, i int) int {
|
||||
n := len(data)
|
||||
for i < n && isalnum(data[i]) {
|
||||
i++
|
||||
}
|
||||
return i
|
||||
}
|
||||
|
||||
func (p *Markdown) htmlFindTag(data []byte) (string, bool) {
|
||||
i := skipAlnum(data, 0)
|
||||
key := string(data[:i])
|
||||
if _, ok := blockTags[key]; ok {
|
||||
return key, true
|
||||
|
|
|
@ -26,8 +26,8 @@ const Version = "2.0"
|
|||
// Extensions is a bitfield of enabled extensions.
|
||||
type Extensions int
|
||||
|
||||
// These are the supported markdown parsing extensions.
|
||||
// OR these values together to select multiple extensions.
|
||||
// Bitflags representing markdown parsing extensions.
|
||||
// Use | (or) to specify multiple extensions.
|
||||
const (
|
||||
NoExtensions Extensions = 0
|
||||
NoIntraEmphasis Extensions = 1 << iota // Ignore emphasis markers inside words
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
# Things to do
|
||||
|
||||
[ ] `go test` is very slow because `doTestsReference()` tests processing of every substring of original markdown. Remove that and add a separate test program for that to be run only in CI
|
||||
[ ] instead of using NodeType, use interface{} for Node data, like xml parser
|
||||
[ ] speed: Node is probably too fat
|
||||
[ ] speed: Node could be allocated from a slice and pointers could be replaces with int32 integers. Node would have to keep track of the allocator or we can change the api to pass both Parser (which is allocator of nodes) and Node (which would be a typedef for int)
|
Loading…
Reference in New Issue