@@ -126,9 +126,9 @@ func convert(r io.Reader, file string, writeBack bool) error {
126126continue
127127}
128128fmt .Fprintf (& md ,"Summary:" )
129- for i ,line := range text .Lines {
129+ for _ ,line := range text .Lines {
130130fmt .Fprintf (& md ," " )
131- printStyled (& md ,line , i == 0 )
131+ printStyled (& md ,line )
132132}
133133fmt .Fprintf (& md ,"\n " )
134134break
@@ -145,10 +145,10 @@ func convert(r io.Reader, file string, writeBack bool) error {
145145log .Fatalf ("%s: unexpected author type %T" ,file ,elem )
146146case present.Text :
147147for _ ,line := range elem .Lines {
148- fmt .Fprintf (& md ,"%s\n " ,markdownEscape (line , true ))
148+ fmt .Fprintf (& md ,"%s\n " ,markdownEscape (line ))
149149}
150150case present.Link :
151- fmt .Fprintf (& md ,"%s\n " ,markdownEscape (elem .Label , true ))
151+ fmt .Fprintf (& md ,"%s\n " ,markdownEscape (elem .Label ))
152152}
153153}
154154}
@@ -174,7 +174,7 @@ func convert(r io.Reader, file string, writeBack bool) error {
174174}else {
175175for _ ,s := range doc .Sections {
176176fmt .Fprintf (& md ,"\n " )
177- fmt .Fprintf (& md ,"## %s\n " ,markdownEscape (s .Title , false ))
177+ fmt .Fprintf (& md ,"## %s\n " ,markdownEscape (s .Title ))
178178printSectionBody (file ,1 ,& md ,s .Elem )
179179}
180180}
@@ -209,7 +209,7 @@ func printSectionBody(file string, depth int, w *bytes.Buffer, elems []present.E
209209}
210210}else {
211211for _ ,line := range elem .Lines {
212- printStyled (w ,line , true )
212+ printStyled (w ,line )
213213fmt .Fprintf (w ,"\n " )
214214}
215215}
@@ -222,7 +222,7 @@ func printSectionBody(file string, depth int, w *bytes.Buffer, elems []present.E
222222if i > 0 {
223223fmt .Fprintf (w ," " )
224224}
225- printStyled (w ,line , false )
225+ printStyled (w ,line )
226226fmt .Fprintf (w ,"\n " )
227227}
228228}
@@ -233,7 +233,7 @@ func printSectionBody(file string, depth int, w *bytes.Buffer, elems []present.E
233233if elem .Title == "" {
234234sep = ""
235235}
236- fmt .Fprintf (w ,"%s%s%s\n " ,strings .Repeat ("#" ,depth + 2 ),sep ,markdownEscape (elem .Title , false ))
236+ fmt .Fprintf (w ,"%s%s%s\n " ,strings .Repeat ("#" ,depth + 2 ),sep ,markdownEscape (elem .Title ))
237237printSectionBody (file ,depth + 1 ,w ,elem .Elem )
238238
239239case interface {PresentCmd ()string }:
@@ -251,7 +251,7 @@ func printSectionBody(file string, depth int, w *bytes.Buffer, elems []present.E
251251}
252252}
253253
254- func markdownEscape (s string , startLine bool )string {
254+ func markdownEscape (s string )string {
255255var b strings.Builder
256256for i ,r := range s {
257257switch {
@@ -282,20 +282,20 @@ func markdownEscape(s string, startLine bool) string {
282282<i>this is italic</i>!
283283*/
284284
285- func printStyled (w * bytes.Buffer ,text string , startLine bool ) {
286- w .WriteString (font (text , startLine ))
285+ func printStyled (w * bytes.Buffer ,text string ) {
286+ w .WriteString (font (text ))
287287}
288288
289289// font returns s with font indicators turned into HTML font tags.
290- func font (s string , startLine bool )string {
290+ func font (s string )string {
291291if ! strings .ContainsAny (s ,"[`_*" ) {
292- return markdownEscape (s , startLine )
292+ return markdownEscape (s )
293293}
294294words := split (s )
295295var b bytes.Buffer
296296Word:
297297for w ,word := range words {
298- words [w ]= markdownEscape (word , startLine && w == 0 )// for all the continue Word
298+ words [w ]= markdownEscape (word )// for all the continue Word
299299if len (word )< 2 {
300300continue Word
301301}
@@ -316,7 +316,7 @@ Word:
316316continue Word
317317}
318318}
319- open ,word := markdownEscape (word [:first ], startLine && w == 0 ),word [first :]
319+ open ,word := markdownEscape (word [:first ]),word [first :]
320320char := word [0 ]// ASCII is OK.
321321close := ""
322322switch char {
@@ -371,7 +371,7 @@ Word:
371371close += "`"
372372}
373373}else {
374- text = markdownEscape (text , false )
374+ text = markdownEscape (text )
375375}
376376words [w ]= open + text + close + tail
377377}
@@ -463,9 +463,9 @@ func parseInlineLink(s string) (link string, length int) {
463463}
464464
465465func renderLink (href ,text string )string {
466- text = font (text , false )
466+ text = font (text )
467467if text == "" {
468- text = markdownEscape (href , false )
468+ text = markdownEscape (href )
469469}
470470return "[" + text + "](" + href + ")"
471471}