advance mdrip to 9efa77d2bf
Change-Id: I600bebf3dd2f3e54cac0d93709feb4fee24207b8
diff --git a/go/src/github.com/monopole/mdrip/README.google b/go/src/github.com/monopole/mdrip/README.google
index efa3e79..0959b32 100644
--- a/go/src/github.com/monopole/mdrip/README.google
+++ b/go/src/github.com/monopole/mdrip/README.google
@@ -1,5 +1,5 @@
-URL: https://github.com/monopole/mdrip/archive/44d228784e161379153583e31bcc32d9a25796e3.zip
-Version: 44d228784e161379153583e31bcc32d9a25796e3
+URL: https://github.com/monopole/mdrip/archive/9efa77d2bf432caa6f48dc45fca93b7d172edd1e.zip
+Version: 9efa77d2bf432caa6f48dc45fca93b7d172edd1e
License: Notice License
License File: LICENSE
diff --git a/go/src/github.com/monopole/mdrip/util/buff_scanner.go b/go/src/github.com/monopole/mdrip/util/buff_scanner.go
index d116cf0..bf9fe3d 100644
--- a/go/src/github.com/monopole/mdrip/util/buff_scanner.go
+++ b/go/src/github.com/monopole/mdrip/util/buff_scanner.go
@@ -24,6 +24,7 @@
// it.
func BuffScanner(wait time.Duration, label string, stream io.ReadCloser, debug bool) <-chan string {
chLine := make(chan string, 1)
+
xScanner := func() <-chan string {
chBuffLine := make(chan string, 1)
go func() {
@@ -95,10 +96,7 @@
return
}
}
-
- if debug {
- fmt.Printf("DEBUG: buffScanner: returning chLine\n")
- }
}()
+
return chLine
}
diff --git a/go/src/github.com/monopole/mdrip/util/lexer.go b/go/src/github.com/monopole/mdrip/util/lexer.go
index e766337..2542836 100644
--- a/go/src/github.com/monopole/mdrip/util/lexer.go
+++ b/go/src/github.com/monopole/mdrip/util/lexer.go
@@ -59,7 +59,7 @@
labelMarker = '@'
commentOpen = "<!--"
commentClose = "-->"
- codeFence = "```\n"
+ codeFence = "```"
)
const eof = -1
@@ -245,13 +245,17 @@
return lexCommandBlock
}
}
- return lexText
}
// lexCommandBlock scans a command block. Initial marker known to be present.
func lexCommandBlock(l *lexer) stateFn {
l.pos += Pos(len(codeFence))
l.ignore()
+ // Ignore any language specifier.
+ if idx := strings.Index(l.input[l.pos:], "\n"); idx > -1 {
+ l.pos += Pos(idx) + 1
+ l.ignore()
+ }
for {
if strings.HasPrefix(l.input[l.pos:], codeFence) {
if l.pos > l.start {
diff --git a/go/src/github.com/monopole/mdrip/util/lexer_test.go b/go/src/github.com/monopole/mdrip/util/lexer_test.go
index 3347549..2895698 100644
--- a/go/src/github.com/monopole/mdrip/util/lexer_test.go
+++ b/go/src/github.com/monopole/mdrip/util/lexer_test.go
@@ -44,6 +44,12 @@
{itemBlockLabel, "4"},
{itemCommandBlock, block2},
tEOF}},
+ {"blockWithLangName", "Hello <!-- @1 -->\n" +
+ "```java\nvoid main whatever\n```",
+ []item{
+ {itemBlockLabel, "1"},
+ {itemCommandBlock, "void main whatever\n"},
+ tEOF}},
}
// collect gathers the emitted items into a slice.
@@ -65,8 +71,8 @@
}
for k := range i1 {
if i1[k].typ != i2[k].typ {
- fmt.Printf("types not equal - got : %s\n", i1[k].typ)
- fmt.Printf("types not equal - want: %s\n", i2[k].typ)
+ fmt.Printf("types not equal - got : %v\n", i1[k].typ)
+ fmt.Printf("types not equal - want: %v\n", i2[k].typ)
fmt.Printf("\n")
return false
}
diff --git a/go/src/github.com/monopole/mdrip/util/runner.go b/go/src/github.com/monopole/mdrip/util/runner.go
index bb0abbd..8152641 100644
--- a/go/src/github.com/monopole/mdrip/util/runner.go
+++ b/go/src/github.com/monopole/mdrip/util/runner.go
@@ -21,7 +21,7 @@
// check reports the error fatally if its non-nil.
func check(msg string, err error) {
if err != nil {
- fmt.Printf("Problem with %s\n", msg, err)
+ fmt.Printf("Problem with %s: %v\n", msg, err)
log.Fatal(err)
}
}