/*
 * Copyright 2013 GitHub Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.mobile.util;

import static java.util.Locale.US;
import android.text.TextUtils;

/**
 * Utilities for dealing with Markdown files
 */
public class MarkdownUtils {

  private static final String[] MARKDOWN_EXTENSIONS = { ".md", ".mkdn",
          ".mdwn", ".mdown", ".markdown", ".mkd", ".mkdown", ".ron" };

  /**
   * Is the the given file name a Markdown file?
   *
   * @param name
   * @return true if the name has a markdown extension, false otherwise
   */
  public static boolean isMarkdown(String name) {
      if (TextUtils.isEmpty(name))
          return false;

      name = name.toLowerCase(US);
      for (String extension : MARKDOWN_EXTENSIONS)
          if (name.endsWith(extension))
              return true;

      return false;
  }
}

@@ -768,16 +768,103 @@
 tils %7B%0A%0A
+    // List of officially supported markup formats: https://github.com/github/markup%0A  
   privat
@@ -910,21 +910,49 @@
 IONS = %7B
- %22.md
+%0A            %22.markdown%22, %22.mdown
 %22, %22.mkd
@@ -954,17 +954,26 @@
 %22.mkdn%22,
-%0A
+ %22.md%22,%0A  
         
@@ -980,74 +980,217 @@
   %22.
-mdwn%22, %22.mdown%22, %22.markdown%22, %22.mkd%22, %22.mkdown%22, %22.ron%22
+textile%22,%0A            %22.rdoc%22,%0A            %22.org%22,%0A            %22.creole%22,%0A            %22.mediawiki%22, %22.wiki %22,%0A            %22.rst%22,%0A            %22.asciidoc%22, %22.adoc%22, %22.asc%22,%0A            %22.pod%22%0A   
  %7D;%0A%0A  
+ 
+ 
 /**%0A
+  
    *
@@ -1237,18 +1237,22 @@
 ile?%0A   
-*%0A
+  *%0A  
    * @pa
@@ -1260,16 +1260,18 @@
 am name%0A
+  
    * @re
@@ -1337,19 +1337,23 @@
 wise%0A   
+  
 */%0A
+  
   public
@@ -1396,24 +1396,26 @@
 me) %7B%0A      
+ 
+ 
 if (TextUtil
@@ -1437,24 +1437,26 @@
 )%0A          
+  
 return false
@@ -1454,24 +1454,26 @@
 urn false;%0A%0A
+  
       name =
@@ -1501,16 +1501,18 @@
 ;%0A      
+  
 for (Str
@@ -1554,24 +1554,26 @@
 )%0A          
+  
 if (name.end
@@ -1600,24 +1600,26 @@
             
+ 
+ 
 return true;
@@ -1616,24 +1616,26 @@
 turn true;%0A%0A
+  
       return
@@ -1642,14 +1642,16 @@
  false;%0A
+  
   %7D%0A%7D%0A

Update the list of supported markup formats