diff --git a/internal/markdown/mutations.go b/internal/markdown/mutations.go
index 8a554f924cea3..eca3fc727cf79 100644
--- a/internal/markdown/mutations.go
+++ b/internal/markdown/mutations.go
@@ -6,6 +6,7 @@ import (
"github.com/Code-Hex/gqldoc/internal/introspection"
"github.com/pkg/errors"
+ "strings"
)
//go:embed mutations.md
@@ -74,9 +75,14 @@ func (m *Config) renderMutation(s *introspection.Schema) error {
if err != nil {
return errors.Wrapf(err, "return type %q has caused error", rf.Type.UnderlyingName())
}
+ // NOTE: If description has newline and its in the table, we need to replace newline to
+ desc := renderHTML(rf.Description)
+ if desc != "" {
+ desc = strings.Replace(desc, "\n", "
", -1)
+ }
rfs = append(rfs, &MutationFieldReturn{
Name: rf.Name,
- Description: renderHTML(rf.Description),
+ Description: desc,
Type: rf.Type.String(),
TypeLink: link,
})