Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Add IAL test and fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
miekg committed Mar 2, 2016
1 parent 22f1005 commit 38982bd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ial.go
Expand Up @@ -18,7 +18,7 @@ func newInlineAttr() *inlineAttr {
return &inlineAttr{class: make(map[string]bool), attr: make(map[string]string)}
}

// Parsing and thus detecting an IAL. Return a valid *IAL or nil.
// Parsing and thus detecting an IAL.
// IAL can have #id, .class or key=value element seperated by spaces, that may be escaped
func (p *parser) isInlineAttr(data []byte) int {
esc := false
Expand Down
15 changes: 15 additions & 0 deletions ial_test.go
@@ -0,0 +1,15 @@
package mmark

import "testing"

func TestIALSyntax(t *testing.T) {
tests := []string{
"{.class key=\"value\"}\n> Quote\n",
"<blockquote class=\"class\" key=\"value\">\n<p>Quote</p>\n</blockquote>\n",

"{.class key=\"va\\}lue\"}\n> Quote\n",
"<blockquote class=\"class\" key=\"va\\}lue\">\n<p>Quote</p>\n</blockquote>\n",
}

doTestsBlock(t, tests, 0)
}

0 comments on commit 38982bd

Please sign in to comment.