mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
bug in tables when a row has too few columns
This commit is contained in:
parent
fbbd3248e9
commit
c99557ec28
4
block.go
4
block.go
|
@ -770,7 +770,7 @@ func (p *parser) tableRow(out *bytes.Buffer, data []byte, columns []int) {
|
|||
i++
|
||||
}
|
||||
|
||||
for col = 0; col < len(columns) && data[i] != '\n'; col++ {
|
||||
for col = 0; col < len(columns) && i < len(data); col++ {
|
||||
for data[i] == ' ' {
|
||||
i++
|
||||
}
|
||||
|
@ -782,6 +782,8 @@ func (p *parser) tableRow(out *bytes.Buffer, data []byte, columns []int) {
|
|||
}
|
||||
|
||||
cellEnd := i
|
||||
|
||||
// skip the end-of-cell marker, possibly taking us past end of buffer
|
||||
i++
|
||||
|
||||
for cellEnd > cellStart && data[cellEnd-1] == ' ' {
|
||||
|
|
Loading…
Reference in New Issue
Block a user