Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5810210606 for ; Fri, 4 Oct 2013 16:30:58 +0000 (UTC) Received: (qmail 29564 invoked by uid 500); 4 Oct 2013 16:30:47 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 28846 invoked by uid 500); 4 Oct 2013 16:30:33 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 28543 invoked by uid 99); 4 Oct 2013 16:30:31 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Oct 2013 16:30:31 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7BAA490FABF; Fri, 4 Oct 2013 16:30:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Fri, 04 Oct 2013 16:30:53 -0000 Message-Id: In-Reply-To: <22c701cf1faa461199ee44abb47bd1f2@git.apache.org> References: <22c701cf1faa461199ee44abb47bd1f2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [25/50] git commit: [#6534] ticket:441 Convert TOC [#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/34df819d Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/34df819d Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/34df819d Branch: refs/heads/cj/5561 Commit: 34df819ddc3a4f4effec146bbbfd4e0703ec3e65 Parents: ea7eb1e Author: Igor Bondarenko Authored: Fri Sep 20 13:58:09 2013 +0300 Committer: Dave Brondsema Committed: Fri Oct 4 14:21:22 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/34df819d/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/34df819d/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