You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using a custom renderer and passing it to blackfriday.Markdown with the extension blackfriday.EXTENSION_NO_INTRA_EMPHASIS. Our renderer implements NormalText to strip unexpected line breaks
// NormalText gets a text chunk *after* the markdown syntax was already
// processed and does a final cleanup on things we don't expect here, like
// removing linebreaks on things that are not a paragraph break (auto unwrap).
func (r *ASCIIRenderer) NormalText(out *bytes.Buffer, text []byte) {
raw := string(text)
lines := strings.Split(raw, linebreak)
for _, line := range lines {
trimmed := strings.Trim(line, " \n\t")
out.WriteString(trimmed)
out.WriteString(" ")
}
}
Text with an internal emphasis (e.g KUBE_EDITOR) is being passed to NormalText with a line break in the middle? This means we cannot remove the line break without either, adding spurious whitespace (i.e KUBE _EDITOR), or missing a space when an expected linebreak was removed.
Do we have the correct expectations for NormalText? Or am I missing something?
thanks
The text was updated successfully, but these errors were encountered:
We are using a custom renderer and passing it to
blackfriday.Markdown
with the extensionblackfriday.EXTENSION_NO_INTRA_EMPHASIS
. Our renderer implementsNormalText
to strip unexpected line breaksText with an internal emphasis (e.g KUBE_EDITOR) is being passed to NormalText with a line break in the middle? This means we cannot remove the line break without either, adding spurious whitespace (i.e KUBE _EDITOR), or missing a space when an expected linebreak was removed.
Do we have the correct expectations for
NormalText
? Or am I missing something?thanks
The text was updated successfully, but these errors were encountered: