From 13d25f86f61bbce247a12b845c3675b57274a13e Mon Sep 17 00:00:00 2001 From: Artem Yunusov Date: Fri, 1 Aug 2008 02:58:48 +0500 Subject: Some cleanups. --- markdown.py | 78 +++++----- tests2/README.txt | 8 -- tests2/formatter.py | 55 ------- .../php-markdown-cases-new/Backslash escapes.html | 14 -- .../php-markdown-cases-new/Backslash escapes.txt | 1 - tests2/php-markdown-cases-new/Code Spans.html | 8 -- tests2/php-markdown-cases-new/Code Spans.txt | 6 - .../Code block in a list item.html | 11 -- .../Code block in a list item.txt | 8 -- .../php-markdown-cases-new/Email auto links.html | 5 - tests2/php-markdown-cases-new/Email auto links.txt | 3 - tests2/php-markdown-cases-new/Emphasis.html | 160 --------------------- tests2/php-markdown-cases-new/Emphasis.txt | 69 --------- tests2/php-markdown-cases-new/Headers.html | 48 ------- tests2/php-markdown-cases-new/Headers.txt | 9 -- .../php-markdown-cases-new/Images (Untitled).html | 8 -- .../php-markdown-cases-new/Images (Untitled).txt | 7 - .../Inline HTML (Simple).html | 17 --- .../Inline HTML (Simple).txt | 15 -- .../php-markdown-cases-new/Inline HTML (Span).html | 5 - .../php-markdown-cases-new/Inline HTML (Span).txt | 4 - .../Inline HTML comments.html | 12 -- .../Inline HTML comments.txt | 9 -- tests2/php-markdown-cases-new/Ins & del.html | 22 --- tests2/php-markdown-cases-new/Ins & del.txt | 17 --- .../Links, inline style.html | 2 - .../php-markdown-cases-new/Links, inline style.txt | 1 - tests2/php-markdown-cases-new/MD5 Hashes.html | 14 -- tests2/php-markdown-cases-new/MD5 Hashes.txt | 11 -- tests2/php-markdown-cases-new/Nesting.html | 17 --- tests2/php-markdown-cases-new/Nesting.tags | 1 - tests2/php-markdown-cases-new/Nesting.txt | 11 -- .../php-markdown-cases-new/PHP-Specific Bugs.html | 20 --- .../php-markdown-cases-new/PHP-Specific Bugs.txt | 22 --- tests2/php-markdown-cases-new/Parens in URL.html | 16 --- tests2/php-markdown-cases-new/Parens in URL.txt | 14 -- tests2/php-markdown-cases-new/Tight blocks.html | 28 ---- tests2/php-markdown-cases-new/Tight blocks.txt | 1 - tests2/renamer | 15 -- tests2/tm-cases-new/auto_link.html | 5 - tests2/tm-cases-new/auto_link.txt | 3 - tests2/tm-cases-new/blockquote.html | 15 -- tests2/tm-cases-new/blockquote.txt | 5 - tests2/tm-cases-new/blockquote_with_pre.html | 9 -- tests2/tm-cases-new/blockquote_with_pre.txt | 6 - tests2/tm-cases-new/code_block_with_tabs.html | 5 - tests2/tm-cases-new/code_block_with_tabs.txt | 3 - tests2/tm-cases-new/codeblock.html | 7 - tests2/tm-cases-new/codeblock.txt | 7 - tests2/tm-cases-new/codespans.html | 3 - tests2/tm-cases-new/codespans.txt | 2 - tests2/tm-cases-new/codespans_safe_mode.html | 3 - tests2/tm-cases-new/codespans_safe_mode.txt | 2 - tests2/tm-cases-new/emphasis.html | 3 - tests2/tm-cases-new/emphasis.txt | 2 - tests2/tm-cases-new/escapes.html | 79 ---------- tests2/tm-cases-new/escapes.txt | 65 --------- tests2/tm-cases-new/header.html | 7 - tests2/tm-cases-new/header.txt | 9 -- tests2/tm-cases-new/hr.html | 13 -- tests2/tm-cases-new/hr.txt | 12 -- tests2/tm-cases-new/img_in_link.html | 6 - tests2/tm-cases-new/img_in_link.txt | 7 - tests2/tm-cases-new/inline_links.html | 11 -- tests2/tm-cases-new/inline_links.txt | 7 - .../tm-cases-new/link_defn_alt_title_delims.html | 4 - tests2/tm-cases-new/link_defn_alt_title_delims.txt | 7 - tests2/tm-cases-new/lists.html | 29 ---- tests2/tm-cases-new/lists.txt | 11 -- tests2/tm-cases-new/lists2.html | 35 ----- tests2/tm-cases-new/lists2.tags | 1 - tests2/tm-cases-new/lists2.txt | 14 -- tests2/tm-cases-new/missing_link_defn.html | 2 - tests2/tm-cases-new/missing_link_defn.txt | 7 - tests2/tm-cases-new/nested_list.html | 28 ---- tests2/tm-cases-new/nested_list.txt | 9 -- tests2/tm-cases-new/parens_in_url_4.html | 2 - tests2/tm-cases-new/parens_in_url_4.txt | 1 - tests2/tm-cases-new/raw_html.html | 6 - tests2/tm-cases-new/raw_html.txt | 6 - tests2/tm-cases-new/ref_links.html | 2 - tests2/tm-cases-new/ref_links.txt | 6 - tests2/tm-cases-new/sublist-para.html | 36 ----- tests2/tm-cases-new/sublist-para.txt | 17 --- tests2/tm-cases-new/tricky_anchors.html | 17 --- tests2/tm-cases-new/tricky_anchors.txt | 11 -- tests2/tm-cases-new/underline_in_autolink.html | 3 - tests2/tm-cases-new/underline_in_autolink.txt | 2 - 88 files changed, 36 insertions(+), 1288 deletions(-) delete mode 100644 tests2/README.txt delete mode 100644 tests2/formatter.py delete mode 100644 tests2/php-markdown-cases-new/Backslash escapes.html delete mode 100644 tests2/php-markdown-cases-new/Backslash escapes.txt delete mode 100644 tests2/php-markdown-cases-new/Code Spans.html delete mode 100644 tests2/php-markdown-cases-new/Code Spans.txt delete mode 100644 tests2/php-markdown-cases-new/Code block in a list item.html delete mode 100644 tests2/php-markdown-cases-new/Code block in a list item.txt delete mode 100644 tests2/php-markdown-cases-new/Email auto links.html delete mode 100644 tests2/php-markdown-cases-new/Email auto links.txt delete mode 100644 tests2/php-markdown-cases-new/Emphasis.html delete mode 100644 tests2/php-markdown-cases-new/Emphasis.txt delete mode 100644 tests2/php-markdown-cases-new/Headers.html delete mode 100644 tests2/php-markdown-cases-new/Headers.txt delete mode 100644 tests2/php-markdown-cases-new/Images (Untitled).html delete mode 100644 tests2/php-markdown-cases-new/Images (Untitled).txt delete mode 100644 tests2/php-markdown-cases-new/Inline HTML (Simple).html delete mode 100644 tests2/php-markdown-cases-new/Inline HTML (Simple).txt delete mode 100644 tests2/php-markdown-cases-new/Inline HTML (Span).html delete mode 100644 tests2/php-markdown-cases-new/Inline HTML (Span).txt delete mode 100644 tests2/php-markdown-cases-new/Inline HTML comments.html delete mode 100644 tests2/php-markdown-cases-new/Inline HTML comments.txt delete mode 100644 tests2/php-markdown-cases-new/Ins & del.html delete mode 100644 tests2/php-markdown-cases-new/Ins & del.txt delete mode 100644 tests2/php-markdown-cases-new/Links, inline style.html delete mode 100644 tests2/php-markdown-cases-new/Links, inline style.txt delete mode 100644 tests2/php-markdown-cases-new/MD5 Hashes.html delete mode 100644 tests2/php-markdown-cases-new/MD5 Hashes.txt delete mode 100644 tests2/php-markdown-cases-new/Nesting.html delete mode 100644 tests2/php-markdown-cases-new/Nesting.tags delete mode 100644 tests2/php-markdown-cases-new/Nesting.txt delete mode 100644 tests2/php-markdown-cases-new/PHP-Specific Bugs.html delete mode 100644 tests2/php-markdown-cases-new/PHP-Specific Bugs.txt delete mode 100644 tests2/php-markdown-cases-new/Parens in URL.html delete mode 100644 tests2/php-markdown-cases-new/Parens in URL.txt delete mode 100644 tests2/php-markdown-cases-new/Tight blocks.html delete mode 100644 tests2/php-markdown-cases-new/Tight blocks.txt delete mode 100755 tests2/renamer delete mode 100644 tests2/tm-cases-new/auto_link.html delete mode 100644 tests2/tm-cases-new/auto_link.txt delete mode 100644 tests2/tm-cases-new/blockquote.html delete mode 100644 tests2/tm-cases-new/blockquote.txt delete mode 100644 tests2/tm-cases-new/blockquote_with_pre.html delete mode 100644 tests2/tm-cases-new/blockquote_with_pre.txt delete mode 100644 tests2/tm-cases-new/code_block_with_tabs.html delete mode 100644 tests2/tm-cases-new/code_block_with_tabs.txt delete mode 100644 tests2/tm-cases-new/codeblock.html delete mode 100644 tests2/tm-cases-new/codeblock.txt delete mode 100644 tests2/tm-cases-new/codespans.html delete mode 100644 tests2/tm-cases-new/codespans.txt delete mode 100644 tests2/tm-cases-new/codespans_safe_mode.html delete mode 100644 tests2/tm-cases-new/codespans_safe_mode.txt delete mode 100644 tests2/tm-cases-new/emphasis.html delete mode 100644 tests2/tm-cases-new/emphasis.txt delete mode 100644 tests2/tm-cases-new/escapes.html delete mode 100644 tests2/tm-cases-new/escapes.txt delete mode 100644 tests2/tm-cases-new/header.html delete mode 100644 tests2/tm-cases-new/header.txt delete mode 100644 tests2/tm-cases-new/hr.html delete mode 100644 tests2/tm-cases-new/hr.txt delete mode 100644 tests2/tm-cases-new/img_in_link.html delete mode 100644 tests2/tm-cases-new/img_in_link.txt delete mode 100644 tests2/tm-cases-new/inline_links.html delete mode 100644 tests2/tm-cases-new/inline_links.txt delete mode 100644 tests2/tm-cases-new/link_defn_alt_title_delims.html delete mode 100644 tests2/tm-cases-new/link_defn_alt_title_delims.txt delete mode 100644 tests2/tm-cases-new/lists.html delete mode 100644 tests2/tm-cases-new/lists.txt delete mode 100644 tests2/tm-cases-new/lists2.html delete mode 100644 tests2/tm-cases-new/lists2.tags delete mode 100644 tests2/tm-cases-new/lists2.txt delete mode 100644 tests2/tm-cases-new/missing_link_defn.html delete mode 100644 tests2/tm-cases-new/missing_link_defn.txt delete mode 100644 tests2/tm-cases-new/nested_list.html delete mode 100644 tests2/tm-cases-new/nested_list.txt delete mode 100644 tests2/tm-cases-new/parens_in_url_4.html delete mode 100644 tests2/tm-cases-new/parens_in_url_4.txt delete mode 100644 tests2/tm-cases-new/raw_html.html delete mode 100644 tests2/tm-cases-new/raw_html.txt delete mode 100644 tests2/tm-cases-new/ref_links.html delete mode 100644 tests2/tm-cases-new/ref_links.txt delete mode 100644 tests2/tm-cases-new/sublist-para.html delete mode 100644 tests2/tm-cases-new/sublist-para.txt delete mode 100644 tests2/tm-cases-new/tricky_anchors.html delete mode 100644 tests2/tm-cases-new/tricky_anchors.txt delete mode 100644 tests2/tm-cases-new/underline_in_autolink.html delete mode 100644 tests2/tm-cases-new/underline_in_autolink.txt diff --git a/markdown.py b/markdown.py index 3891ac3..12fd70d 100755 --- a/markdown.py +++ b/markdown.py @@ -63,8 +63,8 @@ def isstr(s): return isinstance(s, unicode) or isinstance(s, str) def importETree(): - """ Importing best variant of ElementTree - and returning module object """ + """ Imports best variant of ElementTree + and returns module object """ try: # Python 2.5+ @@ -527,10 +527,6 @@ else: LINK_RE = NOIMG + BRK + \ r'''\(\s*(<.*?>|((?:(?:\(.*?\))|[^\(\)]))*?)\s*((['"])(.*)\12)?\)''' # [text](url) or [text]() -#r'''\(\s*(<.*?>|((?:(?:\(.*?\))|[^\(\)]))*)\s*((['"])(.*)\12)?\)''' # [text](url) or [text]() - -#LINK_RE2 = NOIMG + BRK + \ -#r'''\(\s*(((?:(?:\(.*?\))|[^\(\)]))*?|<\10*?>)\s*((['"])(.*)\12)?\)''' # [text](url) or [text]() IMAGE_LINK_RE = r'\!' + BRK + r'\s*\((<.*?>|([^\)]*))\)' # ![alttxt](http://x.com/) or ![alttxt]() REFERENCE_RE = NOIMG + BRK+ r'\s*\[([^\]]*)\]' # [Google][3] @@ -1116,7 +1112,6 @@ class CorePatterns: 'isline2': r'(\-*)', # --- 'isline3': r'(\_*)', # ___ 'tabbed': r'((\t)|( ))(.*)', # an indented line - 'tabbed2': r'(()( ))(.*)', # an indented line 'quoted': r'[ ]{0,2}> ?(.*)', # a quoted block ("> ...") } @@ -1393,32 +1388,32 @@ class Markdown: if lines and not lines[0].strip(): lines = lines[1:] # skip the first (blank) line - def _processHR(self, parent_elem): - hr = etree.SubElement(parent_elem, "hr") + def _processHR(self, parentElem): + hr = etree.SubElement(parentElem, "hr") - def _processHeader(self, parent_elem, paragraph): + def _processHeader(self, parentElem, paragraph): m = RE.regExp['header'].match(paragraph[0]) if m: level = len(m.group(1)) - h = etree.SubElement(parent_elem, "h%d" % level) + h = etree.SubElement(parentElem, "h%d" % level) inline = etree.SubElement(h, "inline") inline.text = m.group(2).strip() else: message(CRITICAL, "We've got a problem header!") - def _processParagraph(self, parent_elem, paragraph, inList, looseList): + def _processParagraph(self, parentElem, paragraph, inList, looseList): - if ( parent_elem.tag == 'li' - and not (looseList or parent_elem.getchildren())): + if ( parentElem.tag == 'li' + and not (looseList or parentElem.getchildren())): # If this is the first paragraph inside "li", don't # put

around it - append the paragraph bits directly - # onto parent_elem - el = parent_elem + # onto parentElem + el = parentElem else: # Otherwise make a "p" element - el = etree.SubElement(parent_elem, "p") + el = etree.SubElement(parentElem, "p") dump = [] @@ -1436,16 +1431,16 @@ class Markdown: inline = etree.SubElement(el, "inline") inline.text = text - def _processUList(self, parent_elem, lines, inList): - self._processList(parent_elem, lines, inList, + def _processUList(self, parentElem, lines, inList): + self._processList(parentElem, lines, inList, listexpr='ul', tag = 'ul') - def _processOList(self, parent_elem, lines, inList): - self._processList(parent_elem, lines, inList, + def _processOList(self, parentElem, lines, inList): + self._processList(parentElem, lines, inList, listexpr='ol', tag = 'ol') - def _processList(self, parent_elem, lines, inList, listexpr, tag): + def _processList(self, parentElem, lines, inList, listexpr, tag): """ Given a list of document lines starting with a list item, finds the end of the list, breaks it up, and recursively @@ -1453,7 +1448,7 @@ class Markdown: Keyword arguments: - * parent_elem: A ElementTree element to which the content will be added + * parentElem: A ElementTree element to which the content will be added * lines: a list of lines * inList: a level @@ -1461,7 +1456,7 @@ class Markdown: """ - ul = etree.SubElement(parent_elem, tag) # ul might actually be '

    ' + ul = etree.SubElement(parentElem, tag) # ul might actually be '
      ' looseList = 0 @@ -1502,7 +1497,7 @@ class Markdown: # Now we need to detect list items (at the current level) # while also detabing child elements if necessary - for expr in ['ul', 'ol', 'tabbed', 'tabbed2']: + for expr in ['ul', 'ol', 'tabbed']: m = RE.regExp[expr].match(line) if m: @@ -1512,7 +1507,7 @@ class Markdown: # at the beginning of the list item items.append([m.group(1)]) item += 1 - elif expr == 'tabbed' or expr == 'tabbed2': # This line needs to be detabbed + elif expr == 'tabbed': # This line needs to be detabbed items[item].append(m.group(4)) #after the 'tab' i += 1 @@ -1531,7 +1526,7 @@ class Markdown: # Process the remaining part of the section - self._processSection(parent_elem, lines[i:], inList) + self._processSection(parentElem, lines[i:], inList) def _linesUntil(self, lines, condition): @@ -1551,7 +1546,7 @@ class Markdown: i += 1 return lines[:i], lines[i:] - def _processQuote(self, parent_elem, lines, inList): + def _processQuote(self, parentElem, lines, inList): """ Given a list of document lines starting with a quote finds the end of the quote, unindents it and recursively @@ -1560,7 +1555,7 @@ class Markdown: Keyword arguments: - * parent_elem: ElementTree element to which the content will be added + * parentElem: ElementTree element to which the content will be added * lines: a list of lines * inList: a level @@ -1587,15 +1582,15 @@ class Markdown: else: break - blockquote = etree.SubElement(parent_elem, "blockquote") + blockquote = etree.SubElement(parentElem, "blockquote") self._processSection(blockquote, dequoted, inList) - self._processSection(parent_elem, lines[i:], inList) + self._processSection(parentElem, lines[i:], inList) - def _processCodeBlock(self, parent_elem, lines, inList): + def _processCodeBlock(self, parentElem, lines, inList): """ Given a list of document lines starting with a code block finds the end of the block, puts it into the ElementTree verbatim @@ -1604,7 +1599,7 @@ class Markdown: Keyword arguments: - * parent_elem: ElementTree element to which the content will be added + * parentElem: ElementTree element to which the content will be added * lines: a list of lines * inList: a level @@ -1614,13 +1609,12 @@ class Markdown: detabbed, theRest = self.blockGuru.detectTabbed(lines) - pre = etree.SubElement(parent_elem, "pre") + pre = etree.SubElement(parentElem, "pre") code = etree.SubElement(pre, "code") text = "\n".join(detabbed).rstrip()+"\n" - #text = text.replace("&", "&") code.text = text - self._processSection(parent_elem, theRest, inList) + self._processSection(parentElem, theRest, inList) def _handleInline(self, data, patternIndex=0): """ @@ -1791,7 +1785,7 @@ class Markdown: Keyword arguments: - * el - parent element of Document. + * el - parent element of ElementTree. Returns: ElementTree object with applied inline patterns. """ @@ -1843,9 +1837,7 @@ class Markdown: Returns: ElementTree object. """ - - - + el = markdownTree.getroot() self._processTree(el) @@ -1855,8 +1847,9 @@ class Markdown: def markdownToTree(self, source=None): """ - Retrun ElementTree, without applying - inline paterns + Retrun ElementTree, without applying inline paterns, + all data, that should be processed with + inline patterns included in sections. Keyword arguments: @@ -1920,6 +1913,7 @@ class Markdown: if self.stripTopLevelTags: xml = xml.strip()[44:-7] + "\n" + # Run the text post-processors for pp in self.textPostprocessors: xml = pp.run(xml) diff --git a/tests2/README.txt b/tests2/README.txt deleted file mode 100644 index 443236f..0000000 --- a/tests2/README.txt +++ /dev/null @@ -1,8 +0,0 @@ -This tests was borrowed from [Python-Markdown2][] implementation. - -Note that php-markdown-cases-new tests is licensed under the [GPL][]. -And tm-cases-new is licensed under the [MIT License][]. - -[Python-Markdown2]: http://code.google.com/p/python-markdown2 -[GPL]: http://www.gnu.org/copyleft/gpl.html -[MIT License]: http://www.opensource.org/licenses/mit-license.php diff --git a/tests2/formatter.py b/tests2/formatter.py deleted file mode 100644 index 26d850f..0000000 --- a/tests2/formatter.py +++ /dev/null @@ -1,55 +0,0 @@ -from __future__ import with_statement -import os - -excl_tm_cases = """basic_safe_mode -basic_safe_mode_escape -auto_link_safe_mode -code_safe_emphasis -emacs_head_vars -emacs_tail_vars -footnotes -footnotes_letters -footnotes_markup -footnotes_safe_mode_escape -nested_list_safe_mode -issue2_safe_mode_borks_markup -issue3_bad_code_color_hack -link_defn_spaces_in_url -link_patterns -link_patterns_double_hit -link_patterns_edge_cases -mismatched_footnotes -nested_lists_safe_mode -pyshell -syntax_color""" - - -def reformat(path, dest, ex=""): - excl = ex.split("\n") - for fname in os.listdir(path): - if fname.endswith(".html"): - if fname[:-5] in excl: - continue - res = processFile(path + fname) - with open(dest + fname, "w") as rfile: - rfile.write(res) - -def processFile(filePath): - with open(filePath) as f: - result = f.read() - result = result.replace("\n\n

      ", "

      ") - result = result.replace("\n<", "<") - result = result.replace("", "\n") - result = result.replace("

    1. ", "
    2. \n") - result = result.replace(">\n

      ", ">

      ") - result = result.replace("\" />", "\"/>") - result = result.replace("

      \n", "\n

      \n") - - return result - -if __name__ == "__main__": - reformat("php-markdown-cases/", "php-markdown-cases-new/") - reformat("tm-cases/", "tm-cases-new/", excl_tm_cases) - - - \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Backslash escapes.html b/tests2/php-markdown-cases-new/Backslash escapes.html deleted file mode 100644 index 6d65ce1..0000000 --- a/tests2/php-markdown-cases-new/Backslash escapes.html +++ /dev/null @@ -1,14 +0,0 @@ -

      Tricky combinaisons: -

      - -

      backslash with \-- two dashes -

      - -

      backslash with \> greater than -

      - -

      \[test](not a link) -

      - -

      \*no emphasis* -

      diff --git a/tests2/php-markdown-cases-new/Backslash escapes.txt b/tests2/php-markdown-cases-new/Backslash escapes.txt deleted file mode 100644 index a5e769b..0000000 --- a/tests2/php-markdown-cases-new/Backslash escapes.txt +++ /dev/null @@ -1 +0,0 @@ -Tricky combinaisons: backslash with \\-- two dashes backslash with \\> greater than \\\[test](not a link) \\\*no emphasis* \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Code Spans.html b/tests2/php-markdown-cases-new/Code Spans.html deleted file mode 100644 index a5a2ddc..0000000 --- a/tests2/php-markdown-cases-new/Code Spans.html +++ /dev/null @@ -1,8 +0,0 @@ -

      From <!-- to --> -on two lines. -

      - -

      From <!-- -to --> -on three lines. -

      diff --git a/tests2/php-markdown-cases-new/Code Spans.txt b/tests2/php-markdown-cases-new/Code Spans.txt deleted file mode 100644 index 43f2bcf..0000000 --- a/tests2/php-markdown-cases-new/Code Spans.txt +++ /dev/null @@ -1,6 +0,0 @@ -From `` -on two lines. - -From `` -on three lines. diff --git a/tests2/php-markdown-cases-new/Code block in a list item.html b/tests2/php-markdown-cases-new/Code block in a list item.html deleted file mode 100644 index ed86f62..0000000 --- a/tests2/php-markdown-cases-new/Code block in a list item.html +++ /dev/null @@ -1,11 +0,0 @@ -
        -
      • List Item: -

        - -
        code block
        -
        -with a blank line
        -

        within a list item. -

        -
      • -
      \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Code block in a list item.txt b/tests2/php-markdown-cases-new/Code block in a list item.txt deleted file mode 100644 index 3fa24c3..0000000 --- a/tests2/php-markdown-cases-new/Code block in a list item.txt +++ /dev/null @@ -1,8 +0,0 @@ - -* List Item: - - code block - - with a blank line - - within a list item. \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Email auto links.html b/tests2/php-markdown-cases-new/Email auto links.html deleted file mode 100644 index 36fb7e7..0000000 --- a/tests2/php-markdown-cases-new/Email auto links.html +++ /dev/null @@ -1,5 +0,0 @@ -

      michel.fortin@michelf.com -

      - -

      International domain names: help@tūdaliņ.lv -

      diff --git a/tests2/php-markdown-cases-new/Email auto links.txt b/tests2/php-markdown-cases-new/Email auto links.txt deleted file mode 100644 index a8af4ec..0000000 --- a/tests2/php-markdown-cases-new/Email auto links.txt +++ /dev/null @@ -1,3 +0,0 @@ - - -International domain names: \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Emphasis.html b/tests2/php-markdown-cases-new/Emphasis.html deleted file mode 100644 index 85a532d..0000000 --- a/tests2/php-markdown-cases-new/Emphasis.html +++ /dev/null @@ -1,160 +0,0 @@ -

      Combined emphasis: -

      - -
        -
      1. -test test -
      2. -
      3. -test test -
      4. -
      5. -test test -
      6. -
      7. -test test -
      8. -
      9. -test test -
      10. -
      11. -test test -
      12. -
      13. -test test -
      14. -
      15. -test test -
      16. -
      17. -test test -
      18. -
      19. -test test -
      20. -
      21. -test test -
      22. -
      23. -test test -
      24. -
      25. -test test -
      26. -
      27. -test test -
      28. -
      29. -test test -
      30. -
      31. -test test -
      32. -
      - -

      Incorrect nesting: -

      - -
        -
      1. -*test test* test -
      2. -
      3. -_test test_ test -
      4. -
      5. -**test test* test* -
      6. -
      7. -__test test_ test_ -
      8. -
      9. -test *test test* -
      10. -
      11. -test _test test_ -
      12. -
      13. -test test test -
      14. -
      15. -test test test -
      16. -
      - -

      No emphasis: -

      - -
        -
      1. -test* test *test -
      2. -
      3. -test** test **test -
      4. -
      5. -test_ test _test -
      6. -
      7. -test__ test __test -
      8. -
      - -

      Middle-word emphasis (asterisks): -

      - -
        -
      1. -ab -
      2. -
      3. -ab -
      4. -
      5. -abc -
      6. -
      7. -ab -
      8. -
      9. -ab -
      10. -
      11. -abc -
      12. -
      - -

      Middle-word emphasis (underscore): -

      - -
        -
      1. -ab -
      2. -
      3. -ab -
      4. -
      5. -abc -
      6. -
      7. -ab -
      8. -
      9. -ab -
      10. -
      11. -abc -
      12. -
      - -

      mypreciousfile.txt -

      - -

      Tricky Cases

      - -

      E**. Test TestTestTest -

      - -

      E**. Test Test Test Test -

      diff --git a/tests2/php-markdown-cases-new/Emphasis.txt b/tests2/php-markdown-cases-new/Emphasis.txt deleted file mode 100644 index ec48dec..0000000 --- a/tests2/php-markdown-cases-new/Emphasis.txt +++ /dev/null @@ -1,69 +0,0 @@ -Combined emphasis: - -1. ***test test*** -2. ___test test___ -3. *test **test*** -4. **test *test*** -5. ***test* test** -6. ***test** test* -7. ***test* test** -8. **test *test*** -9. *test **test*** -10. _test __test___ -11. __test _test___ -12. ___test_ test__ -13. ___test__ test_ -14. ___test_ test__ -15. __test _test___ -16. _test __test___ - - -Incorrect nesting: - -1. *test **test* test** -2. _test __test_ test__ -3. **test *test** test* -4. __test _test__ test_ -5. *test *test* test* -6. _test _test_ test_ -7. **test **test** test** -8. __test __test__ test__ - - - -No emphasis: - -1. test* test *test -2. test** test **test -3. test_ test _test -4. test__ test __test - - - -Middle-word emphasis (asterisks): - -1. *a*b -2. a*b* -3. a*b*c -4. **a**b -5. a**b** -6. a**b**c - - -Middle-word emphasis (underscore): - -1. _a_b -2. a_b_ -3. a_b_c -4. __a__b -5. a__b__ -6. a__b__c - -my_precious_file.txt - - -## Tricky Cases - -E**. **Test** TestTestTest - -E**. **Test** Test Test Test diff --git a/tests2/php-markdown-cases-new/Headers.html b/tests2/php-markdown-cases-new/Headers.html deleted file mode 100644 index 84628d3..0000000 --- a/tests2/php-markdown-cases-new/Headers.html +++ /dev/null @@ -1,48 +0,0 @@ -

      Header

      - -

      Header

      - -

      Header

      - -
      - -

      Header

      - -

      Paragraph -

      - -

      Header

      - -

      Paragraph -

      - -

      Header

      - -

      Paragraph -

      - -
      - -

      Paragraph -

      - -

      Header

      - -

      Paragraph -

      - -

      Paragraph -

      - -

      Header

      - -

      Paragraph -

      - -

      Paragraph -

      - -

      Header

      - -

      Paragraph -

      diff --git a/tests2/php-markdown-cases-new/Headers.txt b/tests2/php-markdown-cases-new/Headers.txt deleted file mode 100644 index 3a39174..0000000 --- a/tests2/php-markdown-cases-new/Headers.txt +++ /dev/null @@ -1,9 +0,0 @@ -Header ====== Header ------ ### Header - - - - - - -Header ====== Paragraph Header ------ Paragraph ### Header Paragraph - - - - - - -Paragraph Header ====== Paragraph Paragraph Header ------ Paragraph Paragraph ### Header Paragraph \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Images (Untitled).html b/tests2/php-markdown-cases-new/Images (Untitled).html deleted file mode 100644 index 6ca4df1..0000000 --- a/tests2/php-markdown-cases-new/Images (Untitled).html +++ /dev/null @@ -1,8 +0,0 @@ -

      alt text -

      - -

      alt text -

      - -

      alt text -

      diff --git a/tests2/php-markdown-cases-new/Images (Untitled).txt b/tests2/php-markdown-cases-new/Images (Untitled).txt deleted file mode 100644 index cb481de..0000000 --- a/tests2/php-markdown-cases-new/Images (Untitled).txt +++ /dev/null @@ -1,7 +0,0 @@ -![alt text](/url/) - -![alt text]() - -![alt text][foo] - - [foo]: /url/ \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Inline HTML (Simple).html b/tests2/php-markdown-cases-new/Inline HTML (Simple).html deleted file mode 100644 index 2bb568d..0000000 --- a/tests2/php-markdown-cases-new/Inline HTML (Simple).html +++ /dev/null @@ -1,17 +0,0 @@ -

      With some attributes: -

      - -
      - foo -
      - -
      - foo -
      - -

      Hr's: -

      - -
      \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Inline HTML (Simple).txt b/tests2/php-markdown-cases-new/Inline HTML (Simple).txt deleted file mode 100644 index 9177105..0000000 --- a/tests2/php-markdown-cases-new/Inline HTML (Simple).txt +++ /dev/null @@ -1,15 +0,0 @@ -With some attributes: - -
      - foo -
      - -
      - foo -
      - -Hr's: - -
      diff --git a/tests2/php-markdown-cases-new/Inline HTML (Span).html b/tests2/php-markdown-cases-new/Inline HTML (Span).html deleted file mode 100644 index beddfe2..0000000 --- a/tests2/php-markdown-cases-new/Inline HTML (Span).html +++ /dev/null @@ -1,5 +0,0 @@ -

      ACINACS -

      - -

      SB -SB

      \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Inline HTML (Span).txt b/tests2/php-markdown-cases-new/Inline HTML (Span).txt deleted file mode 100644 index 19028bb..0000000 --- a/tests2/php-markdown-cases-new/Inline HTML (Span).txt +++ /dev/null @@ -1,4 +0,0 @@ -ACINACS - -SB -SB \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Inline HTML comments.html b/tests2/php-markdown-cases-new/Inline HTML comments.html deleted file mode 100644 index 877bcfb..0000000 --- a/tests2/php-markdown-cases-new/Inline HTML comments.html +++ /dev/null @@ -1,12 +0,0 @@ -

      Paragraph one. -

      - - - -

      Paragraph two. -

      - - - -

      The end. -

      diff --git a/tests2/php-markdown-cases-new/Inline HTML comments.txt b/tests2/php-markdown-cases-new/Inline HTML comments.txt deleted file mode 100644 index d57d00a..0000000 --- a/tests2/php-markdown-cases-new/Inline HTML comments.txt +++ /dev/null @@ -1,9 +0,0 @@ -Paragraph one. - - - -Paragraph two. - - - -The end. diff --git a/tests2/php-markdown-cases-new/Ins & del.html b/tests2/php-markdown-cases-new/Ins & del.html deleted file mode 100644 index f5997a7..0000000 --- a/tests2/php-markdown-cases-new/Ins & del.html +++ /dev/null @@ -1,22 +0,0 @@ -

      Here is a block tag ins: -

      - - -

      Some text

      -
      - -And here it is inside a paragraph. - - -

      And here it is in the middle of a paragraph. -

      - - -

      Some text

      -
      - -And here is ins as a paragraph. - - -

      And here it is in the middle of a paragraph. -

      diff --git a/tests2/php-markdown-cases-new/Ins & del.txt b/tests2/php-markdown-cases-new/Ins & del.txt deleted file mode 100644 index 2d54c66..0000000 --- a/tests2/php-markdown-cases-new/Ins & del.txt +++ /dev/null @@ -1,17 +0,0 @@ -Here is a block tag ins: - - -

      Some text

      -
      - -And here it is inside a paragraph. - -And here it is in the middle of a paragraph. - - -

      Some text

      -
      - -And here is ins as a paragraph. - -And here it is in the middle of a paragraph. diff --git a/tests2/php-markdown-cases-new/Links, inline style.html b/tests2/php-markdown-cases-new/Links, inline style.html deleted file mode 100644 index 195cedf..0000000 --- a/tests2/php-markdown-cases-new/Links, inline style.html +++ /dev/null @@ -1,2 +0,0 @@ -

      silly URL w/ angle brackets. -

      diff --git a/tests2/php-markdown-cases-new/Links, inline style.txt b/tests2/php-markdown-cases-new/Links, inline style.txt deleted file mode 100644 index 600a044..0000000 --- a/tests2/php-markdown-cases-new/Links, inline style.txt +++ /dev/null @@ -1 +0,0 @@ -[silly URL w/ angle brackets](). diff --git a/tests2/php-markdown-cases-new/MD5 Hashes.html b/tests2/php-markdown-cases-new/MD5 Hashes.html deleted file mode 100644 index 91283e0..0000000 --- a/tests2/php-markdown-cases-new/MD5 Hashes.html +++ /dev/null @@ -1,14 +0,0 @@ -

      Character Escapes

      - -

      The MD5 value for + is "26b17225b626fb9238849fd60eabdf60". -

      - -

      HTML Blocks

      - -

      test

      - -

      The MD5 value for <p>test</p> is: -

      - -

      6205333b793f34273d75379350b36826 -

      diff --git a/tests2/php-markdown-cases-new/MD5 Hashes.txt b/tests2/php-markdown-cases-new/MD5 Hashes.txt deleted file mode 100644 index 7e03221..0000000 --- a/tests2/php-markdown-cases-new/MD5 Hashes.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Character Escapes - -The MD5 value for `+` is "26b17225b626fb9238849fd60eabdf60". - -# HTML Blocks - -

      test

      - -The MD5 value for `

      test

      ` is: - -6205333b793f34273d75379350b36826 \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Nesting.html b/tests2/php-markdown-cases-new/Nesting.html deleted file mode 100644 index be47e21..0000000 --- a/tests2/php-markdown-cases-new/Nesting.html +++ /dev/null @@ -1,17 +0,0 @@ -

      Valid nesting: -

      - -

      Link -

      - -

      Link -

      - -

      Link -

      - -

      Invalid nesting: -

      - -

      [Link](url) -

      diff --git a/tests2/php-markdown-cases-new/Nesting.tags b/tests2/php-markdown-cases-new/Nesting.tags deleted file mode 100644 index cb77ed3..0000000 --- a/tests2/php-markdown-cases-new/Nesting.tags +++ /dev/null @@ -1 +0,0 @@ -knownfailure dontcare diff --git a/tests2/php-markdown-cases-new/Nesting.txt b/tests2/php-markdown-cases-new/Nesting.txt deleted file mode 100644 index 791538c..0000000 --- a/tests2/php-markdown-cases-new/Nesting.txt +++ /dev/null @@ -1,11 +0,0 @@ -Valid nesting: - -**[Link](url)** - -[**Link**](url) - -**[**Link**](url)** - -Invalid nesting: - -[[Link](url)](url) \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/PHP-Specific Bugs.html b/tests2/php-markdown-cases-new/PHP-Specific Bugs.html deleted file mode 100644 index 19943dd..0000000 --- a/tests2/php-markdown-cases-new/PHP-Specific Bugs.html +++ /dev/null @@ -1,20 +0,0 @@ -

      This tests for a bug where quotes escaped by PHP when using -preg_replace with the /e modifier must be correctly unescaped -(hence the _UnslashQuotes function found only in PHP Markdown). -

      - -

      Headers below should appear exactly as they are typed (no backslash -added or removed). -

      - -

      Header "quoted\" again \""

      - -

      Header "quoted\" again \""

      - -

      Header "quoted\" again \""

      - -

      Test with tabs for _Detab: -

      - -
      Code    'block' with    some    "tabs"  and "quotes"
      -
      diff --git a/tests2/php-markdown-cases-new/PHP-Specific Bugs.txt b/tests2/php-markdown-cases-new/PHP-Specific Bugs.txt deleted file mode 100644 index 246b60d..0000000 --- a/tests2/php-markdown-cases-new/PHP-Specific Bugs.txt +++ /dev/null @@ -1,22 +0,0 @@ -This tests for a bug where quotes escaped by PHP when using -`preg_replace` with the `/e` modifier must be correctly unescaped -(hence the `_UnslashQuotes` function found only in PHP Markdown). - - - -Headers below should appear exactly as they are typed (no backslash -added or removed). - -Header "quoted\" again \\"" -=========================== - -Header "quoted\" again \\"" ---------------------------- - -### Header "quoted\" again \\"" ### - - - -Test with tabs for `_Detab`: - - Code 'block' with some "tabs" and "quotes" diff --git a/tests2/php-markdown-cases-new/Parens in URL.html b/tests2/php-markdown-cases-new/Parens in URL.html deleted file mode 100644 index 24254ff..0000000 --- a/tests2/php-markdown-cases-new/Parens in URL.html +++ /dev/null @@ -1,16 +0,0 @@ -

      Inline link 1 with parens. -

      - -

      Inline link 2 with parens. -

      - -

      Inline link 3 with non-escaped parens. -

      - -

      Inline link 4 with non-escaped parens. -

      - -

      Reference link 1 with parens. -

      - -

      Reference link 2 with parens.

      \ No newline at end of file diff --git a/tests2/php-markdown-cases-new/Parens in URL.txt b/tests2/php-markdown-cases-new/Parens in URL.txt deleted file mode 100644 index bb7be4f..0000000 --- a/tests2/php-markdown-cases-new/Parens in URL.txt +++ /dev/null @@ -1,14 +0,0 @@ -[Inline link 1 with parens](/url\(test\) "title"). - -[Inline link 2 with parens]( "title"). - -[Inline link 3 with non-escaped parens](/url(test) "title"). - -[Inline link 4 with non-escaped parens]( "title"). - -[Reference link 1 with parens][1]. - -[Reference link 2 with parens][2]. - - [1]: /url(test) "title" - [2]: "title" diff --git a/tests2/php-markdown-cases-new/Tight blocks.html b/tests2/php-markdown-cases-new/Tight blocks.html deleted file mode 100644 index 3d9342d..0000000 --- a/tests2/php-markdown-cases-new/Tight blocks.html +++ /dev/null @@ -1,28 +0,0 @@ -

      Paragraph and no space: -* ciao -

      - -

      Paragraph and 1 space: - * ciao -

      - -

      Paragraph and 3 spaces: - * ciao -

      - -

      Paragraph and 4 spaces: - * ciao -

      - -

      Paragraph before header: -

      - -

      Header

      - -

      Paragraph before blockquote: -

      - -
      -

      Some quote. -

      -
      diff --git a/tests2/php-markdown-cases-new/Tight blocks.txt b/tests2/php-markdown-cases-new/Tight blocks.txt deleted file mode 100644 index ae4cdcb..0000000 --- a/tests2/php-markdown-cases-new/Tight blocks.txt +++ /dev/null @@ -1 +0,0 @@ -Paragraph and no space: * ciao Paragraph and 1 space: * ciao Paragraph and 3 spaces: * ciao Paragraph and 4 spaces: * ciao Paragraph before header: #Header Paragraph before blockquote: >Some quote. \ No newline at end of file diff --git a/tests2/renamer b/tests2/renamer deleted file mode 100755 index 24add6f..0000000 --- a/tests2/renamer +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -test_dirs=( "markdowntest-cases" "php-markdown-cases" "php-markdown-extra-cases" "tm-cases" ) - -old_ext="text" -new_ext="txt" - -for (( i = 0 ; i < "${#test_dirs[@]}"; i++ )) -do - for j in "${test_dirs[$i]}"/*.${old_ext} - do - mv "$j" "${j/.text}".${new_ext} - done -done - - diff --git a/tests2/tm-cases-new/auto_link.html b/tests2/tm-cases-new/auto_link.html deleted file mode 100644 index 8299181..0000000 --- a/tests2/tm-cases-new/auto_link.html +++ /dev/null @@ -1,5 +0,0 @@ -

      I can has autolink? http://icanhascheeseburger.com -

      -

      Ask garfield: garfield@example.com -

      - diff --git a/tests2/tm-cases-new/auto_link.txt b/tests2/tm-cases-new/auto_link.txt deleted file mode 100644 index e5354cd..0000000 --- a/tests2/tm-cases-new/auto_link.txt +++ /dev/null @@ -1,3 +0,0 @@ -I can has autolink? - -Ask garfield: diff --git a/tests2/tm-cases-new/blockquote.html b/tests2/tm-cases-new/blockquote.html deleted file mode 100644 index 7a35052..0000000 --- a/tests2/tm-cases-new/blockquote.html +++ /dev/null @@ -1,15 +0,0 @@ -

      [Trent wrote] -

      - -
      -

      no way -

      -
      - -

      [Jeff wrote] -

      - -
      -

      way -

      -
      diff --git a/tests2/tm-cases-new/blockquote.txt b/tests2/tm-cases-new/blockquote.txt deleted file mode 100644 index 3bcecaa..0000000 --- a/tests2/tm-cases-new/blockquote.txt +++ /dev/null @@ -1,5 +0,0 @@ -[Trent wrote] -> no way - -[Jeff wrote] -> way diff --git a/tests2/tm-cases-new/blockquote_with_pre.html b/tests2/tm-cases-new/blockquote_with_pre.html deleted file mode 100644 index 431c06a..0000000 --- a/tests2/tm-cases-new/blockquote_with_pre.html +++ /dev/null @@ -1,9 +0,0 @@ -
      -

      Markdown indents blockquotes a couple of spaces - necessitating some tweaks for pre-blocks in that - blockquote: -

      - -
      here is a check
      -for that
      -
      diff --git a/tests2/tm-cases-new/blockquote_with_pre.txt b/tests2/tm-cases-new/blockquote_with_pre.txt deleted file mode 100644 index e61b82f..0000000 --- a/tests2/tm-cases-new/blockquote_with_pre.txt +++ /dev/null @@ -1,6 +0,0 @@ -> Markdown indents blockquotes a couple of spaces -> necessitating some tweaks for pre-blocks in that -> blockquote: -> -> here is a check -> for that diff --git a/tests2/tm-cases-new/code_block_with_tabs.html b/tests2/tm-cases-new/code_block_with_tabs.html deleted file mode 100644 index cc12d18..0000000 --- a/tests2/tm-cases-new/code_block_with_tabs.html +++ /dev/null @@ -1,5 +0,0 @@ -

      Test with tabs for _Detab: -

      - -
      Code    'block' with    some    "tabs"  and "quotes"
      -
      diff --git a/tests2/tm-cases-new/code_block_with_tabs.txt b/tests2/tm-cases-new/code_block_with_tabs.txt deleted file mode 100644 index bcf94c4..0000000 --- a/tests2/tm-cases-new/code_block_with_tabs.txt +++ /dev/null @@ -1,3 +0,0 @@ -Test with tabs for `_Detab`: - - Code 'block' with some "tabs" and "quotes" diff --git a/tests2/tm-cases-new/codeblock.html b/tests2/tm-cases-new/codeblock.html deleted file mode 100644 index f9e04d0..0000000 --- a/tests2/tm-cases-new/codeblock.html +++ /dev/null @@ -1,7 +0,0 @@ -
      some code
      -

      some 'splaining -

      - -
      some more code
      -2 > 1
      -
      diff --git a/tests2/tm-cases-new/codeblock.txt b/tests2/tm-cases-new/codeblock.txt deleted file mode 100644 index d374216..0000000 --- a/tests2/tm-cases-new/codeblock.txt +++ /dev/null @@ -1,7 +0,0 @@ - some code - -some 'splaining - - some more code - 2 > 1 - diff --git a/tests2/tm-cases-new/codespans.html b/tests2/tm-cases-new/codespans.html deleted file mode 100644 index b9994a1..0000000 --- a/tests2/tm-cases-new/codespans.html +++ /dev/null @@ -1,3 +0,0 @@ -

      This is a code span. -And This is one with an `embedded backtick`. -

      diff --git a/tests2/tm-cases-new/codespans.txt b/tests2/tm-cases-new/codespans.txt deleted file mode 100644 index 67015a9..0000000 --- a/tests2/tm-cases-new/codespans.txt +++ /dev/null @@ -1,2 +0,0 @@ -`This` is a code span. -And ``This is one with an `embedded backtick` ``. diff --git a/tests2/tm-cases-new/codespans_safe_mode.html b/tests2/tm-cases-new/codespans_safe_mode.html deleted file mode 100644 index b9994a1..0000000 --- a/tests2/tm-cases-new/codespans_safe_mode.html +++ /dev/null @@ -1,3 +0,0 @@ -

      This is a code span. -And This is one with an `embedded backtick`. -

      diff --git a/tests2/tm-cases-new/codespans_safe_mode.txt b/tests2/tm-cases-new/codespans_safe_mode.txt deleted file mode 100644 index 67015a9..0000000 --- a/tests2/tm-cases-new/codespans_safe_mode.txt +++ /dev/null @@ -1,2 +0,0 @@ -`This` is a code span. -And ``This is one with an `embedded backtick` ``. diff --git a/tests2/tm-cases-new/emphasis.html b/tests2/tm-cases-new/emphasis.html deleted file mode 100644 index 08ea3d9..0000000 --- a/tests2/tm-cases-new/emphasis.html +++ /dev/null @@ -1,3 +0,0 @@ -

      This is italic and this is bold. -This is also italic and this is bold. -

      diff --git a/tests2/tm-cases-new/emphasis.txt b/tests2/tm-cases-new/emphasis.txt deleted file mode 100644 index 99c324e..0000000 --- a/tests2/tm-cases-new/emphasis.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is *italic* and this is **bold**. -This is also _italic_ and this is __bold__. diff --git a/tests2/tm-cases-new/escapes.html b/tests2/tm-cases-new/escapes.html deleted file mode 100644 index bcf6f3c..0000000 --- a/tests2/tm-cases-new/escapes.html +++ /dev/null @@ -1,79 +0,0 @@ -

      Backslash-escapes: basics

      - -

      **don't shout** -

      - -

      *don't emphasize* -

      - -

      _literal underscores_ -

      - -

      __more literal underscores__ -

      - -

      This header has trailing hash marks ##

      - -

      Backslash-escapes: links

      - -

      This is not a [link](/url/). -

      - -

      This is a link, not an image link: !link. -

      - -

      Should this be an http://autolink\ or not? -I'll ask on markdown-discuss. -I suspect PHP markdown is considering this NOT an autolink. -

      - -

      This is not a [link definition][link1] but this is. -

      - -

      Backslash-escapse: code blocks

      - -

      In a code block: -

      - -
      escapes should \*not\* be \_interpreted\_
      -even \`backticks\`
      -
      - -

      Backslash-escapse: code spans

      - -

      Getting backticks and backslash-escapes working correctly with -code spans can be tricky: -

      - -

      a normal code span -

      - -

      need multiple backticks to include a literal ` backtick -

      - -

      `use a leading space to start a code span with a backtick -

      - -

      use a trailing space to end a code span with a backtick` -

      - -

      backslash-escapes \(are\) \*not\* \`interpreted\` in a code span -

      - -

      `a code span prefixed with a literal backtick -

      - -

      `not a code span` -

      - -

      Note A: The (?!`) after the \1 group in the -_DoCodeSpans()/_do_code_spans() regex is necessary to ensure that a backtick -doesn't match at the start of the code block (group \2) in an example like -this: -

      - -
        -
      • -`foo -
      • -
      diff --git a/tests2/tm-cases-new/escapes.txt b/tests2/tm-cases-new/escapes.txt deleted file mode 100644 index dbfc2b5..0000000 --- a/tests2/tm-cases-new/escapes.txt +++ /dev/null @@ -1,65 +0,0 @@ -# Backslash-escapes: basics - -\*\*don't shout\*\* - -\*don't emphasize\* - -\_literal underscores\_ - -\_\_more literal underscores\_\_ - -## This header has trailing hash marks \#\# - - -# Backslash-escapes: links - -This is not a \[link](/url/). - -This is a link, not an image link: \![link](/url/). - -Should this be an or not? -I'll ask on markdown-discuss. -I suspect PHP markdown is considering this NOT an autolink. - -This is not a [link definition\][link1] but [this is][link1]. - -[link1]: /url/ - - -# Backslash-escapse: code blocks - -In a code block: - - escapes should \*not\* be \_interpreted\_ - even \`backticks\` - - -# Backslash-escapse: code spans - -Getting backticks and backslash-escapes working correctly with -code spans can be tricky: - -`a normal code span` - -``need multiple backticks to include a literal ` backtick`` - -`` `use a leading space to start a code span with a backtick`` - -``use a trailing space to end a code span with a backtick` `` - -``backslash-escapes \(are\) \*not\* \`interpreted\` in a code span`` - -\``a code span prefixed with a literal backtick` - -\`not a code span\` - - -*Note A*: The `` (?!`) `` after the `\1` group in the -`_DoCodeSpans()/_do_code_spans()` regex is necessary to ensure that a backtick -doesn't match at the start of the code block (group `\2`) in an example like -this: - -- ``foo` - - - diff --git a/tests2/tm-cases-new/header.html b/tests2/tm-cases-new/header.html deleted file mode 100644 index 90fc68a..0000000 --- a/tests2/tm-cases-new/header.html +++ /dev/null @@ -1,7 +0,0 @@ -

      an h1

      - -

      an h2

      - -

      another h1

      - -

      another h2

      diff --git a/tests2/tm-cases-new/header.txt b/tests2/tm-cases-new/header.txt deleted file mode 100644 index b20ad13..0000000 --- a/tests2/tm-cases-new/header.txt +++ /dev/null @@ -1,9 +0,0 @@ -# an h1 - -## an h2 - -another h1 -========== - -another h2 ----------- diff --git a/tests2/tm-cases-new/hr.html b/tests2/tm-cases-new/hr.html deleted file mode 100644 index 83c3ac2..0000000 --- a/tests2/tm-cases-new/hr.html +++ /dev/null @@ -1,13 +0,0 @@ -

      Dashes: -

      - -
      - -
      - -
      - -
      - -
      ---
      -
      diff --git a/tests2/tm-cases-new/hr.txt b/tests2/tm-cases-new/hr.txt deleted file mode 100644 index 765b735..0000000 --- a/tests2/tm-cases-new/hr.txt +++ /dev/null @@ -1,12 +0,0 @@ -Dashes: - ---- - - --- - - --- - - --- - - --- - diff --git a/tests2/tm-cases-new/img_in_link.html b/tests2/tm-cases-new/img_in_link.html deleted file mode 100644 index b51d5d6..0000000 --- a/tests2/tm-cases-new/img_in_link.html +++ /dev/null @@ -1,6 +0,0 @@ -

      This example from -http://orestis.gr/en/blog/2007/05/28/python-markdown-problems/: -

      - -

      the google logo -

      diff --git a/tests2/tm-cases-new/img_in_link.txt b/tests2/tm-cases-new/img_in_link.txt deleted file mode 100644 index 98f6075..0000000 --- a/tests2/tm-cases-new/img_in_link.txt +++ /dev/null @@ -1,7 +0,0 @@ -This example from -: - -[![the google logo][logo]][google] -[logo]: http://www.google.com/images/logo.gif -[google]: http://www.google.com/ "click to visit Google.com" - diff --git a/tests2/tm-cases-new/inline_links.html b/tests2/tm-cases-new/inline_links.html deleted file mode 100644 index 8c5a4fb..0000000 --- a/tests2/tm-cases-new/inline_links.html +++ /dev/null @@ -1,11 +0,0 @@ -

      an inline link -

      - -

      a link "with" title -

      - -

      an inline image link -

      - -

      an image "with" title -

      diff --git a/tests2/tm-cases-new/inline_links.txt b/tests2/tm-cases-new/inline_links.txt deleted file mode 100644 index 444a997..0000000 --- a/tests2/tm-cases-new/inline_links.txt +++ /dev/null @@ -1,7 +0,0 @@ -an inline [link](/url/) - -a [link "with" title](/url/ "title") - -an inline ![image link](/url/) - -an ![image "with" title](/url/ "title") diff --git a/tests2/tm-cases-new/link_defn_alt_title_delims.html b/tests2/tm-cases-new/link_defn_alt_title_delims.html deleted file mode 100644 index 0ff3742..0000000 --- a/tests2/tm-cases-new/link_defn_alt_title_delims.html +++ /dev/null @@ -1,4 +0,0 @@ -

      Alternative delimiters for link definitions are allowed -- as of -Markdown 1.0.2, I think. Hence, this link and this link work -too. -

      diff --git a/tests2/tm-cases-new/link_defn_alt_title_delims.txt b/tests2/tm-cases-new/link_defn_alt_title_delims.txt deleted file mode 100644 index 3d62b11..0000000 --- a/tests2/tm-cases-new/link_defn_alt_title_delims.txt +++ /dev/null @@ -1,7 +0,0 @@ -Alternative delimiters for [link definitions][link1] are allowed -- as of -Markdown 1.0.2, I think. Hence, [this link][link2] and [this link][link3] work -too. - -[link1]: http://daringfireball.net/projects/markdown/syntax#link "link syntax" -[link2]: http://daringfireball.net/projects/markdown/syntax#link 'link syntax' -[link3]: http://daringfireball.net/projects/markdown/syntax#link (link syntax) diff --git a/tests2/tm-cases-new/lists.html b/tests2/tm-cases-new/lists.html deleted file mode 100644 index 5d7ec15..0000000 --- a/tests2/tm-cases-new/lists.html +++ /dev/null @@ -1,29 +0,0 @@ -

      count: -

      - -
        -
      • -one -
      • -
      • -two -
      • -
      • -three -
      • -
      - -

      count in spanish: -

      - -
        -
      1. -uno -
      2. -
      3. -dos -
      4. -
      5. -tres -
      6. -
      diff --git a/tests2/tm-cases-new/lists.txt b/tests2/tm-cases-new/lists.txt deleted file mode 100644 index 8d2b43c..0000000 --- a/tests2/tm-cases-new/lists.txt +++ /dev/null @@ -1,11 +0,0 @@ -count: - -* one -* two -* three - -count in spanish: - -1. uno -2. dos -3. tres diff --git a/tests2/tm-cases-new/lists2.html b/tests2/tm-cases-new/lists2.html deleted file mode 100644 index d0e20c8..0000000 --- a/tests2/tm-cases-new/lists2.html +++ /dev/null @@ -1,35 +0,0 @@ -

      mixed bullets: -

      - -
        -
      • -a -
      • -
      • -b -
      • -
      • -c -
      • -
      - -

      ul followed by ol: -

      - -
        -
      • -a -
      • -
      • -b -
      • -
      - -
        -
      1. -1 -
      2. -
      3. -2 -
      4. -
      diff --git a/tests2/tm-cases-new/lists2.tags b/tests2/tm-cases-new/lists2.tags deleted file mode 100644 index e6b969b..0000000 --- a/tests2/tm-cases-new/lists2.tags +++ /dev/null @@ -1 +0,0 @@ -issue16 diff --git a/tests2/tm-cases-new/lists2.txt b/tests2/tm-cases-new/lists2.txt deleted file mode 100644 index 54123d1..0000000 --- a/tests2/tm-cases-new/lists2.txt +++ /dev/null @@ -1,14 +0,0 @@ -mixed bullets: - -* a -- b -+ c - - -ul followed by ol: - -- a -- b - -1. 1 -2. 2 diff --git a/tests2/tm-cases-new/missing_link_defn.html b/tests2/tm-cases-new/missing_link_defn.html deleted file mode 100644 index bafd445..0000000 --- a/tests2/tm-cases-new/missing_link_defn.html +++ /dev/null @@ -1,2 +0,0 @@ -

      This is a [missing link][missing] and a used link. -

      diff --git a/tests2/tm-cases-new/missing_link_defn.txt b/tests2/tm-cases-new/missing_link_defn.txt deleted file mode 100644 index 817677f..0000000 --- a/tests2/tm-cases-new/missing_link_defn.txt +++ /dev/null @@ -1,7 +0,0 @@ - -This is a [missing link][missing] and a [used link][used]. - - -[used]: http://foo.com -[unused]: http://foo.com - diff --git a/tests2/tm-cases-new/nested_list.html b/tests2/tm-cases-new/nested_list.html deleted file mode 100644 index d370acd..0000000 --- a/tests2/tm-cases-new/nested_list.html +++ /dev/null @@ -1,28 +0,0 @@ -

      shopping list: -

      - -
        -
      • -veggies
          -
        • -carrots -
        • -
        • -lettuce -
        • -
        -
      • -
      • -fruits
          -
        • -oranges -
        • -
        • -apples -
        • -
        • -peaches -
        • -
        -
      • -
      diff --git a/tests2/tm-cases-new/nested_list.txt b/tests2/tm-cases-new/nested_list.txt deleted file mode 100644 index a37a195..0000000 --- a/tests2/tm-cases-new/nested_list.txt +++ /dev/null @@ -1,9 +0,0 @@ -shopping list: - -- veggies - + carrots - + lettuce -- fruits - + oranges - + apples - + *peaches* diff --git a/tests2/tm-cases-new/parens_in_url_4.html b/tests2/tm-cases-new/parens_in_url_4.html deleted file mode 100644 index edccf0d..0000000 --- a/tests2/tm-cases-new/parens_in_url_4.html +++ /dev/null @@ -1,2 +0,0 @@ -

      Inline link 4 with non-escaped parens. -

      diff --git a/tests2/tm-cases-new/parens_in_url_4.txt b/tests2/tm-cases-new/parens_in_url_4.txt deleted file mode 100644 index 5dfb9ab..0000000 --- a/tests2/tm-cases-new/parens_in_url_4.txt +++ /dev/null @@ -1 +0,0 @@ -[Inline link 4 with non-escaped parens]( "title"). diff --git a/tests2/tm-cases-new/raw_html.html b/tests2/tm-cases-new/raw_html.html deleted file mode 100644 index 2ae6fe9..0000000 --- a/tests2/tm-cases-new/raw_html.html +++ /dev/null @@ -1,6 +0,0 @@ -

      Hi, there. blah -

      - -
      - **ack** -
      diff --git a/tests2/tm-cases-new/raw_html.txt b/tests2/tm-cases-new/raw_html.txt deleted file mode 100644 index 13cde37..0000000 --- a/tests2/tm-cases-new/raw_html.txt +++ /dev/null @@ -1,6 +0,0 @@ - -Hi, *there*. blah - -
      - **ack** -
      diff --git a/tests2/tm-cases-new/ref_links.html b/tests2/tm-cases-new/ref_links.html deleted file mode 100644 index 7fb1582..0000000 --- a/tests2/tm-cases-new/ref_links.html +++ /dev/null @@ -1,2 +0,0 @@ -

      Google is fast star. -

      diff --git a/tests2/tm-cases-new/ref_links.txt b/tests2/tm-cases-new/ref_links.txt deleted file mode 100644 index 4df8c01..0000000 --- a/tests2/tm-cases-new/ref_links.txt +++ /dev/null @@ -1,6 +0,0 @@ -[Google][] is fast ![star][]. - -[google]: http://www.google.com/ -[star]: /img/star.png - - diff --git a/tests2/tm-cases-new/sublist-para.html b/tests2/tm-cases-new/sublist-para.html deleted file mode 100644 index f1d47bf..0000000 --- a/tests2/tm-cases-new/sublist-para.html +++ /dev/null @@ -1,36 +0,0 @@ -

      Some quick thoughts from a coder's perspective: -

      - -
        -
      • The source will be available in a Mercurial ... -

        -
      • -
      • Komodo is a Mozilla-based application... -

        - -
          -
        • -Get a slightly tweaked mozilla build (C++, JavaScript, XUL). -
        • -
        • -Get a slightly tweaks Python build (C). -
        • -
        • -Add a bunch of core logic (Python)... -
        • -
        • -Add Komodo chrome (XUL, JavaScript, CSS, DTDs). -
        • -
        - -

        What this means is that work on and add significant functionality... -

        -
      • -
      • Komodo uses the same extension mechanisms as Firefox... -

        -
      • -
      • Komodo builds and runs on Windows, Linux and ... -

        -
      • -
      -

      diff --git a/tests2/tm-cases-new/sublist-para.txt b/tests2/tm-cases-new/sublist-para.txt deleted file mode 100644 index 7bf07ba..0000000 --- a/tests2/tm-cases-new/sublist-para.txt +++ /dev/null @@ -1,17 +0,0 @@ -Some quick thoughts from a coder's perspective: - -- The source will be available in a Mercurial ... - -- Komodo is a Mozilla-based application... - - - Get a slightly tweaked mozilla build (C++, JavaScript, XUL). - - Get a slightly tweaks Python build (C). - - Add a bunch of core logic (Python)... - - Add Komodo chrome (XUL, JavaScript, CSS, DTDs). - - What this means is that work on and add significant functionality... - -- Komodo uses the same extension mechanisms as Firefox... - -- Komodo builds and runs on Windows, Linux and ... - diff --git a/tests2/tm-cases-new/tricky_anchors.html b/tests2/tm-cases-new/tricky_anchors.html deleted file mode 100644 index af40218..0000000 --- a/tests2/tm-cases-new/tricky_anchors.html +++ /dev/null @@ -1,17 +0,0 @@ -

      with [brackets][] in text -

      - -

      with [[brackets][]] in text -

      - -

      full link [like](/this/) in text -

      - -

      full link to img like is ok -

      - -

      [only open bracket(/in/) text -

      - -

      only close bracket text](/url/) -

      diff --git a/tests2/tm-cases-new/tricky_anchors.txt b/tests2/tm-cases-new/tricky_anchors.txt deleted file mode 100644 index 217f685..0000000 --- a/tests2/tm-cases-new/tricky_anchors.txt +++ /dev/null @@ -1,11 +0,0 @@ -[with [brackets][] in text](/url/) - -[with [[brackets][]] in text](/url/ "a title") - -[full link [like](/this/) in text](/url/) - -[full link to img ![like](/this/) is ok](/url/) - -[only open [bracket(/in/) text](/url/ 'a title') - -[only close bracket](/in/) text](/url/) diff --git a/tests2/tm-cases-new/underline_in_autolink.html b/tests2/tm-cases-new/underline_in_autolink.html deleted file mode 100644 index f5f21eb..0000000 --- a/tests2/tm-cases-new/underline_in_autolink.html +++ /dev/null @@ -1,3 +0,0 @@ -

      Eric wrote up a (long) intro to writing UDL definitions a while back on -his blog: http://blogs.activestate.com/ericp/2007/01/kid_adding_a_ne.html -

      diff --git a/tests2/tm-cases-new/underline_in_autolink.txt b/tests2/tm-cases-new/underline_in_autolink.txt deleted file mode 100644 index 58ae3e0..0000000 --- a/tests2/tm-cases-new/underline_in_autolink.txt +++ /dev/null @@ -1,2 +0,0 @@ -Eric wrote up a (long) intro to writing UDL definitions a while back on -his blog: -- cgit v1.2.3