Commits

Anonymous committed 11d3e92

add embedded video support
fix wiki links

  • Participants
  • Parent commits c6fb489

Comments (0)

Files changed (3)

File couchit/template.py

         base_url = local.site_url + '/'
     else:
         base_url = ''
-    """md = markdown.Markdown(
-            extensions = ['codehilite', 'wikilinks', 'footnotes'],
-            extension_configs = {'wikilinks': [
-                                        ('base_url', base_url),
-                                        ('html_class', ''),
-                                        ('end_url', '') ]}
-    )"""
+    
     link_patterns = [
         (re.compile("\[\[\s*([^\]]+)\]\]", re.U), r'%s\1' % base_url, 1),
-        (re.compile(r"(\b[A-Z][a-z]+[A-Z]\w+\b)", re.U), r"%s\1" % base_url, 0)
+        (re.compile(r"(^| )(\b[A-Z][a-z]+[A-Z]\w+\b)", re.U), r"%s\1" % base_url, 0)
+        
     ]
     
     md = markdown2.Markdown(extras=["link-patterns", "codehilite"],

File couchit/utils/html.py

 class _HTMLSanitizer(_BaseHTMLProcessor):
     acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area', 'b', 'big',
       'blockquote', 'br', 'button', 'caption', 'center', 'cite', 'code', 'col',
-      'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'fieldset',
+      'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset',
       'font', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'input',
-      'ins', 'kbd', 'label', 'legend', 'li', 'map', 'menu', 'ol', 'optgroup',
-      'option', 'p', 'pre', 'q', 's', 'samp', 'select', 'small', 'span', 'strike',
+      'ins', 'kbd', 'label', 'legend', 'li', 'map', 'menu', 'object', 'ol', 'optgroup',
+      'option', 'p', 'param', 'pre', 'q', 's', 'samp', 'select', 'small', 'span', 'strike',
       'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th',
       'thead', 'tr', 'tt', 'u', 'ul', 'var']
 
     acceptable_attributes = ['abbr', 'accept', 'accept-charset', 'accesskey',
-      'action', 'align', 'alt', 'axis', 'border', 'cellpadding', 'cellspacing',
+      'action', 'align', 'alt', 'allowfullscreen', 'allowScriptAccess', 'axis', 'border', 'cellpadding', 'cellspacing',
       'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'clear', 'cols',
       'colspan', 'color', 'compact', 'coords', 'datetime', 'dir', 'disabled',
       'enctype', 'for', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace',

File static/js/lib/showdown.js

 	);
 	
 	/* wiki links */
-    text = text.replace(/(\b[A-Z][a-z]+[A-Z][\w\u00A1-\uFFFF]+\b)/, "<a href=\""+Site.url+"/$1\">$1</a>");
+    text = text.replace(/(^| )(\b[A-Z][a-z]+[A-Z][\w\u00A1-\uFFFF]+\b)/, "<a href=\""+Site.url+"/$1\">$1</a>");
     text = text.replace(/\[\[\s*([^\]]+)\]\]/, "<a href=\""+Site.url+"/$1\">$1</a>")
 
 	return text;