tweak comments; add todo.md

This commit is contained in:
Krzysztof Kowalczyk 2018-01-25 15:08:57 -08:00
parent 2366615cad
commit 904c88f346
3 changed files with 16 additions and 5 deletions

View File

@ -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

View File

@ -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

6
todo.md Normal file
View File

@ -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)