~shulhan/asciidoctor-go

ref: v0.1.0 asciidoctor-go/table_cell.go -rw-r--r-- 558 bytes
4c1ded16Shulhan Release asciidoctor-go v0.1.0 (2021-03-06) 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2020, Shulhan <ms@kilabit.info>. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package asciidoctor

type tableCell struct {
	content []byte
	format  cellFormat
}

func (tc *tableCell) writeString(s string) {
	tc.content = append(tc.content, []byte(s)...)
}

func (tc *tableCell) writeByte(b byte) {
	tc.content = append(tc.content, b)
}

func (tc *tableCell) endWithLF() bool {
	l := len(tc.content)
	if l == 0 {
		return false
	}
	return tc.content[l-1] == '\n'
}