diff options
Diffstat (limited to 'src/com/gitblit/utils/MarkdownUtils.java')
-rw-r--r-- | src/com/gitblit/utils/MarkdownUtils.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/MarkdownUtils.java b/src/com/gitblit/utils/MarkdownUtils.java index 697fa99b..c7c1f9fe 100644 --- a/src/com/gitblit/utils/MarkdownUtils.java +++ b/src/com/gitblit/utils/MarkdownUtils.java @@ -23,8 +23,21 @@ import java.io.StringWriter; import org.tautua.markdownpapers.Markdown;
import org.tautua.markdownpapers.parser.ParseException;
+/**
+ * Utility methods for transforming raw markdown text to html.
+ *
+ * @author James Moger
+ *
+ */
public class MarkdownUtils {
+ /**
+ * Returns the html version of the markdown source text.
+ *
+ * @param markdown
+ * @return html version of markdown text
+ * @throws java.text.ParseException
+ */
public static String transformMarkdown(String markdown) throws java.text.ParseException {
try {
return transformMarkdown(new StringReader(markdown));
@@ -33,6 +46,14 @@ public class MarkdownUtils { }
}
+ /**
+ * Returns the html version of the markdown source reader. The reader is
+ * closed regardless of success or failure.
+ *
+ * @param markdownReader
+ * @return html version of the markdown text
+ * @throws java.text.ParseException
+ */
public static String transformMarkdown(Reader markdownReader) throws java.text.ParseException {
// Read raw markdown content and transform it to html
StringWriter writer = new StringWriter();
|