Removes some code that doesn't make much sense. Commented in case it needs to be added back later.
This commit is contained in:
parent
9d4b5a2763
commit
2d1bef7488
17
main.go
17
main.go
|
@ -494,13 +494,16 @@ func (ctx *textifyTraverseContext) emit(data string) error {
|
|||
)
|
||||
for _, line := range lines {
|
||||
runes := []rune(line)
|
||||
startsWithSpace := unicode.IsSpace(runes[0])
|
||||
if !startsWithSpace && !ctx.endsWithSpace && !strings.HasPrefix(data, ".") {
|
||||
if err = ctx.buf.WriteByte(' '); err != nil {
|
||||
return err
|
||||
}
|
||||
ctx.lineLength++
|
||||
}
|
||||
// XXX I cannot figure out for the life of me why a single space indent
|
||||
// was being added here. But it was really wonky... so let's ditch it?
|
||||
//
|
||||
// startsWithSpace := unicode.IsSpace(runes[0])
|
||||
// if !startsWithSpace && !ctx.endsWithSpace && !strings.HasPrefix(data, ".") {
|
||||
// if err = ctx.buf.WriteByte(' '); err != nil {
|
||||
// return err
|
||||
// }
|
||||
// ctx.lineLength++
|
||||
// }
|
||||
ctx.endsWithSpace = unicode.IsSpace(runes[len(runes)-1])
|
||||
for _, c := range line {
|
||||
if _, err = ctx.buf.WriteString(string(c)); err != nil {
|
||||
|
|
Loading…
Reference in New Issue