equal
deleted
inserted
replaced
114 var last byte |
114 var last byte |
115 if bl > 0 { |
115 if bl > 0 { |
116 last = b.Bytes()[bl-1] |
116 last = b.Bytes()[bl-1] |
117 } |
117 } |
118 |
118 |
|
119 // Add heading space if needed |
|
120 if last != ' ' && last != '\n' && last != '#' && last != '@' { |
|
121 b.WriteString(" ") |
|
122 } |
|
123 |
119 var tmpbuf bytes.Buffer |
124 var tmpbuf bytes.Buffer |
120 for c := n.FirstChild; c != nil; c = c.NextSibling { |
125 for c := n.FirstChild; c != nil; c = c.NextSibling { |
121 process(c, &tmpbuf, class) |
126 process(c, &tmpbuf, class) |
122 } |
127 } |
123 |
128 |
124 if class == "tag" || class == "h-card" || last == '@' { |
129 if class == "tag" || class == "h-card" || last == '@' { |
125 b.Write(tmpbuf.Bytes()) |
130 b.Write(tmpbuf.Bytes()) |
126 return |
131 return |
127 } |
|
128 |
|
129 // Add heading space if needed |
|
130 if last != ' ' && last != '\n' { |
|
131 b.WriteString(" ") |
|
132 } |
132 } |
133 |
133 |
134 s := tmpbuf.String() |
134 s := tmpbuf.String() |
135 if strings.HasPrefix(s, "#") || strings.HasPrefix(s, "@") { |
135 if strings.HasPrefix(s, "#") || strings.HasPrefix(s, "@") { |
136 b.WriteString(s) // Tag or mention: display content |
136 b.WriteString(s) // Tag or mention: display content |