-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Markdown formatting will mangle some types of text by default. For example, if the text entered as the Description contains This is sentence one and should not be On the same line as sentence two then markdown will merge these lines together as This is sentence one and should not be On the same line as sentence two. To fix this add a --force-linebreak option to replace line breaks, "\n", with " \n" [1]. Signed-off-by: Prarit Bhargava <prarit@redhat.com> [1] https://gist.github.com/shaunlebron/746476e6e7a4d698b373.
- Loading branch information
Showing
7 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// This file contains common functions that are shared in the lab package | ||
package cmd | ||
|
||
import ( | ||
"strings" | ||
) | ||
|
||
// textToMarkdown converts text with markdown friendly line breaks | ||
// See https://gist.github.com/shaunlebron/746476e6e7a4d698b373 for more info. | ||
func textToMarkdown(text string) string { | ||
text = strings.Replace(text, "\n", " \n", -1) | ||
return text | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test_textToMarkdown(t *testing.T) { | ||
basestring := "This string should have two spaces at the end." | ||
teststring := basestring + "\n" | ||
newteststring := textToMarkdown(teststring) | ||
assert.Equal(t, basestring+" \n", newteststring) | ||
} |