func escapeFirstAsterixInEachPair()

in renderer/asciidoctor.go [169:183]


func escapeFirstAsterixInEachPair(text string) string {
	index := -1
	for i := 0; i < len(text); i++ {
		if text[i] == '*' {
			if index >= 0 {
				text = text[:index] + "\\" + text[index:]
				index = -1
				i++
			} else {
				index = i
			}
		}
	}
	return text
}