incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [27/36] git commit: [#6534] ticket:441 Convert TOC
Date Fri, 27 Sep 2013 16:43:32 GMT
[#6534] ticket:441 Convert TOC


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/54ade38e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/54ade38e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/54ade38e

Branch: refs/heads/db/6534
Commit: 54ade38ee2af91f5269264457b3cc6ddd7cd1ade
Parents: 2b0c547
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Sep 20 13:58:09 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 27 16:40:24 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tests/test_wiki.py | 5 +++++
 ForgeImporters/forgeimporters/github/wiki.py            | 3 +++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54ade38e/ForgeImporters/forgeimporters/github/tests/test_wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tests/test_wiki.py b/ForgeImporters/forgeimporters/github/tests/test_wiki.py
index 94fd139..3947c53 100644
--- a/ForgeImporters/forgeimporters/github/tests/test_wiki.py
+++ b/ForgeImporters/forgeimporters/github/tests/test_wiki.py
@@ -172,6 +172,11 @@ class TestGitHubWikiImporter(TestCase):
         assert_equal(f(u"'[[https://sf.net]]"), u'[[https://sf.net]]')
         assert_equal(f(u"'[[SourceForge|http://sf.net]]"), u'[[SourceForge|http://sf.net]]')
 
+    def test_convert_gollum_toc(self):
+        f = GitHubWikiImporter().convert_gollum_tags
+        assert_equal(f(u'[[_TOC_]]'), u'[TOC]')
+        assert_equal(f(u"'[[_TOC_]]"), u'[[_TOC_]]')
+
     def test_convert_gollum_tags(self):
         f = GitHubWikiImporter().convert_gollum_tags
         source = u'''Look at [[this page|Some Page]]

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54ade38e/ForgeImporters/forgeimporters/github/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/wiki.py b/ForgeImporters/forgeimporters/github/wiki.py
index a3db81f..c61193d 100644
--- a/ForgeImporters/forgeimporters/github/wiki.py
+++ b/ForgeImporters/forgeimporters/github/wiki.py
@@ -268,6 +268,9 @@ class GitHubWikiImporter(ToolImporter):
         else:
             title, link, options = link[0], link[1], link[2:]
 
+        if link == '_TOC_':
+            return '[TOC]'
+
         if link.startswith('http://') or link.startswith('https://'):
             sub = self._gollum_external_link
         # TODO: add embedded images and file links


Mime
View raw message