@@ -151,7 +151,7 @@ func (adr *AsciidoctorRenderer) TemplateValue(key string) string {
151151func (adr * AsciidoctorRenderer ) RenderFieldDoc (text string ) string {
152152 // Escape the pipe character, which has special meaning for asciidoc as a way to format tables,
153153 // so that including | in a comment does not result in wonky tables.
154- out := strings . ReplaceAll (text , "|" , " \\ |" )
154+ out := escapePipe (text )
155155
156156 // Trim any leading and trailing whitespace from each line.
157157 lines := strings .Split (out , "\n " )
@@ -194,12 +194,12 @@ func escapeFirstAsterixInEachPair(text string) string {
194194// escapePipe ensures sufficient escapes are added to pipe characters, so they are not mistaken
195195// for asciidoctor table formatting.
196196func escapePipe (text string ) string {
197- return strings .Replace (text , "|" , "\\ |" , - 1 )
197+ return strings .ReplaceAll (text , "|" , "\\ |" )
198198}
199199
200200// escapeCurlyBraces ensures sufficient escapes are added to curly braces, so they are not mistaken
201201// for asciidoctor id attributes.
202202func escapeCurlyBraces (text string ) string {
203203 // Per asciidoctor docs, only the leading curly brace needs to be escaped.
204- return strings .Replace (text , "{" , "\\ {" , - 1 )
204+ return strings .ReplaceAll (text , "{" , "\\ {" )
205205}
0 commit comments