{"action":"created","comment":{"url":"https://api.github.com/repos/opf/openproject/pulls/comments/33034398","id":33034398,"diff_hunk":"@@ -573,6 +573,670 @@ def controller\n \n     subject(:html) { format_text(wiki_text) }\n \n+    context 'w/ request present' do\n+\n+      let(:request) { ActionController::TestRequest.new }\n+      let(:url_for) { '/test' }\n+\n+      it 'emits a table of contents for headings h1-h4 with links present' do\n+        expect(html).to be_html_eql(%{\n+          <fieldset class='form--fieldset -collapsible'>\n+            <legend class='form--fieldset-legend' title='Show/Hide table of contents' onclick='toggleFieldset(this);'>\n+              <a href='javascript:'>Table of Contents</a>\n+            </legend>\n+            <div>\n+              <ul class=\"toc\">\n+                <li>\n+                  <a href=\"/test#Orange\">Orange</a>\n+                  <ul>\n+                    <li>\n+                      <a href=\"/test#Varietes\">Varietes</a>\n+                      <ul>\n+                        <li>\n+                          <a href=\"/test#Common-Oranges\">Common Oranges</a>\n+                          <ul>\n+                            <li><a href=\"/test#Valencia\">Valencia</a></li>\n+                            <li><a href=\"/test#Harts-Tardiff-Valencia\">Hart's Tardiff Valencia</a></li>\n+                          </ul>\n+                        </li>\n+                        <li><a href=\"/test#Navel-Oranges\">Navel Oranges</a></li>\n+                        <li><a href=\"/test#Blood-Oranges\">Blood Oranges</a></li>\n+                        <li><a href=\"/test#Acidless-Oranges\">Acidless Oranges</a></li>\n+                      </ul>\n+                    </li>\n+                    <li><a href=\"/test#Attributes\">Attributes</a></li>\n+                  </ul>\n+                </li>\n+              </ul>\n+            </div>\n+          </fieldset>\n+        }).at_path('fieldset')\n+      end\n+    end\n+\n+    context 'w/o request present' do\n+\n+      let(:request) { nil }\n+\n+      it 'emits a table of contents for headings h1-h4 with anchors' do\n+        expect(html).to be_html_eql(%{\n+          <fieldset class='form--fieldset -collapsible'>\n+            <legend class='form--fieldset-legend' title='Show/Hide table of contents' onclick='toggleFieldset(this);'>\n+              <a href='javascript:'>Table of Contents</a>\n+            </legend>\n+            <div>\n+              <ul class=\"toc\">\n+                <li>\n+                  <a href=\"#Orange\">Orange</a>\n+                  <ul>\n+                    <li>\n+                      <a href=\"#Varietes\">Varietes</a>\n+                      <ul>\n+                        <li>\n+                          <a href=\"#Common-Oranges\">Common Oranges</a>\n+                          <ul>\n+                            <li><a href=\"#Valencia\">Valencia</a></li>\n+                            <li><a href=\"#Harts-Tardiff-Valencia\">Hart's Tardiff Valencia</a></li>\n+                          </ul>\n+                        </li>\n+                        <li><a href=\"#Navel-Oranges\">Navel Oranges</a></li>\n+                        <li><a href=\"#Blood-Oranges\">Blood Oranges</a></li>\n+                        <li><a href=\"#Acidless-Oranges\">Acidless Oranges</a></li>\n+                      </ul>\n+                    </li>\n+                    <li><a href=\"#Attributes\">Attributes</a></li>\n+                  </ul>\n+                </li>\n+              </ul>\n+            </div>\n+          </fieldset>\n+        }).at_path('fieldset')\n+      end\n+    end\n+  end\n+\n+  context 'deprecated methods' do\n+    subject { self }\n+\n+    it { is_expected.to respond_to :textilizable }\n+    it { is_expected.to respond_to :textilize    }\n+  end\n+end\n+#-- copyright\n+# OpenProject is a project management system.\n+# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)\n+#\n+# This program is free software; you can redistribute it and/or\n+# modify it under the terms of the GNU General Public License version 3.\n+#\n+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:\n+# Copyright (C) 2006-2013 Jean-Philippe Lang\n+# Copyright (C) 2010-2013 the ChiliProject Team\n+#\n+# This program is free software; you can redistribute it and/or\n+# modify it under the terms of the GNU General Public License\n+# as published by the Free Software Foundation; either version 2\n+# of the License, or (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, write to the Free Software\n+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n+#\n+# See doc/COPYRIGHT.rdoc for more details.\n+#++\n+\n+require 'spec_helper'\n+\n+describe OpenProject::TextFormatting do\n+  include OpenProject::TextFormatting\n+  include WorkPackagesHelper # soft-dependency\n+  include ActionView::Helpers::UrlHelper # soft-dependency\n+  include ActionView::Context\n+  include OpenProject::StaticRouting::UrlHelpers\n+\n+  def controller\n+    # no-op\n+  end\n+\n+  describe '.format_text' do\n+    let(:project) { FactoryGirl.create :valid_project }\n+    let(:identifier) { project.identifier }\n+    let(:project_member) {\n+      FactoryGirl.create :user,\n+                         member_in_project: project,\n+                         member_through_role: FactoryGirl.create(:role,\n+                                                                 permissions: [:view_work_packages, :edit_work_packages,\n+                                                                               :browse_repository, :view_changesets, :view_wiki_pages])\n+    }\n+    let(:issue) {\n+      FactoryGirl.create :work_package,\n+                         project: project,\n+                         author: project_member,\n+                         type: project.types.first\n+    }\n+\n+    before do\n+      @project = project\n+\n+      allow(User).to receive(:current).and_return(project_member)\n+      allow(Setting).to receive(:text_formatting).and_return('textile')\n+    end\n+\n+    context \"Changeset links\" do\n+      let(:repository) do\n+        FactoryGirl.build_stubbed :repository,\n+                                  project: project\n+      end\n+      let(:changeset1) do\n+        FactoryGirl.build_stubbed :changeset,\n+                                  repository: repository,\n+                                  comments: 'My very first commit'\n+      end\n+      let(:changeset2) do\n+        FactoryGirl.build_stubbed :changeset,\n+                                  repository: repository,\n+                                  comments: 'This commit fixes #1, #2 and references #1 & #3'\n+      end\n+      let(:changeset_link) {\n+        link_to(\"r#{changeset1.revision}\",\n+                { controller: 'repositories', action: 'revision', project_id: identifier, rev: changeset1.revision },\n+                class: 'changeset', title: 'My very first commit')\n+      }\n+      let(:changeset_link2) {\n+        link_to(\"r#{changeset2.revision}\",\n+                { controller: 'repositories', action: 'revision', project_id: identifier, rev: changeset2.revision },\n+                class: 'changeset', title: 'This commit fixes #1, #2 and references #1 & #3')\n+      }\n+\n+      before do\n+        allow(project).to receive(:repository).and_return(repository)\n+\n+        changesets = [changeset1, changeset2]\n+\n+        allow(Changeset).to receive(:visible).and_return(changesets)\n+\n+        changesets.each do |changeset|\n+          allow(changesets)\n+            .to receive(:find_by_repository_id_and_revision)\n+            .with(project.repository.id, changeset.revision)\n+            .and_return(changeset)\n+        end\n+      end\n+\n+      context 'Single link' do\n+        subject { format_text(\"r#{changeset1.revision}\") }\n+\n+        it { is_expected.to eq(\"<p>#{changeset_link}</p>\") }\n+      end\n+\n+      context 'Single link with dot' do\n+        subject { format_text(\"r#{changeset1.revision}.\") }\n+\n+        it { is_expected.to eq(\"<p>#{changeset_link}.</p>\") }\n+      end\n+\n+      context 'Two links comma separated' do\n+        subject { format_text(\"r#{changeset1.revision}, r#{changeset2.revision}\") }\n+\n+        it { is_expected.to eq(\"<p>#{changeset_link}, #{changeset_link2}</p>\") }\n+      end\n+\n+      context 'Single link comma separated without a space' do\n+        subject { format_text(\"r#{changeset1.revision},r#{changeset2.revision}\") }\n+\n+        it { is_expected.to eq(\"<p>#{changeset_link},#{changeset_link2}</p>\") }\n+      end\n+\n+      context 'Escaping' do\n+        subject { format_text(\"!r#{changeset1.id}\") }\n+\n+        it { is_expected.to eq(\"<p>r#{changeset1.id}</p>\") }\n+      end\n+    end\n+\n+    context 'Version link' do\n+      let!(:version) {\n+        FactoryGirl.create :version,\n+                           name: '1.0',\n+                           project: project\n+      }\n+      let(:version_link) {\n+        link_to('1.0',\n+                { controller: 'versions', action: 'show', id: version.id },\n+                class: 'version')\n+      }\n+\n+      context 'Link with version id' do\n+        subject { format_text(\"version##{version.id}\") }\n+\n+        it { is_expected.to eq(\"<p>#{version_link}</p>\") }\n+      end\n+\n+      context 'Link with version' do\n+        subject { format_text('version:1.0') }\n+        it { is_expected.to eq(\"<p>#{version_link}</p>\") }\n+      end\n+\n+      context 'Link with quoted version' do\n+        subject { format_text('version:\"1.0\"') }\n+\n+        it { is_expected.to eq(\"<p>#{version_link}</p>\") }\n+      end\n+\n+      context 'Escaping link with version id' do\n+        subject { format_text(\"!version##{version.id}\") }\n+\n+        it { is_expected.to eq(\"<p>version##{version.id}</p>\") }\n+      end\n+\n+      context 'Escaping link with version' do\n+        subject { format_text('!version:1.0') }\n+\n+        it { is_expected.to eq('<p>version:1.0</p>') }\n+      end\n+\n+      context 'Escaping link with quoted version' do\n+        subject { format_text('!version:\"1.0\"') }\n+\n+        it { is_expected.to eq('<p>version:\"1.0\"</p>') }\n+      end\n+    end\n+\n+    context 'Message links' do\n+      let(:board) { FactoryGirl.create :board, project: project }\n+      let(:message1) { FactoryGirl.create :message, board: board }\n+      let(:message2) {\n+        FactoryGirl.create :message,\n+                           board: board,\n+                           parent: message1\n+      }\n+\n+      before do\n+        message1.reload\n+      end\n+\n+      context 'Plain message' do\n+        subject { format_text(\"message##{message1.id}\") }\n+\n+        it { is_expected.to eq(\"<p>#{link_to(message1.subject, topic_path(message1), class: 'message')}</p>\") }\n+      end\n+\n+      context 'Message with parent' do\n+        subject { format_text(\"message##{message2.id}\") }\n+\n+        it { is_expected.to eq(\"<p>#{link_to(message2.subject, topic_path(message1, anchor: \"message-#{message2.id}\", r: message2.id), class: 'message')}</p>\") }\n+      end\n+    end\n+\n+    context 'Issue links' do\n+      let(:issue_link) {\n+        link_to(\"##{issue.id}\",\n+                work_package_path(issue),\n+                class: 'issue work_package status-3 priority-1 created-by-me', title: \"#{issue.subject} (#{issue.status})\")\n+      }\n+\n+      context 'Plain issue link' do\n+        subject { format_text(\"##{issue.id}, [##{issue.id}], (##{issue.id}) and ##{issue.id}.\") }\n+\n+        it { is_expected.to eq(\"<p>#{issue_link}, [#{issue_link}], (#{issue_link}) and #{issue_link}.</p>\") }\n+      end\n+\n+      context 'Plain issue link to non-existing element' do\n+        subject { format_text('#0123456789') }\n+\n+        it { is_expected.to eq('<p>#0123456789</p>') }\n+      end\n+\n+      context 'Escaping issue link' do\n+        subject { format_text(\"!##{issue.id}.\") }\n+\n+        it { is_expected.to eq(\"<p>##{issue.id}.</p>\") }\n+      end\n+\n+      context 'Cyclic Description Links' do\n+        let(:issue2) {\n+          FactoryGirl.create :work_package,\n+                             project: project,\n+                             author: project_member,\n+                             type: project.types.first\n+        }\n+\n+        before do\n+          issue2.description = \"####{issue.id}\"\n+          issue2.save!\n+          issue.description = \"####{issue2.id}\"\n+          issue.save!\n+        end\n+\n+        subject { format_text issue, :description }\n+\n+        it \"doesn't replace description links with a cycle\" do\n+          expect(subject).to match(\"###{issue.id}\")\n+        end\n+      end\n+\n+      context 'Description links' do\n+        subject { format_text issue, :description }\n+\n+        it 'replaces the macro with the issue description' do\n+          expect(subject).to eq(\"<p>#{issue.description}</p>\")\n+        end\n+      end\n+    end\n+\n+    context 'Project links' do\n+      let(:subproject) { FactoryGirl.create :valid_project, parent: project, is_public: true }\n+      let(:project_url) { { controller: 'projects', action: 'show', id: subproject.identifier } }\n+\n+      context 'Plain project link' do\n+        subject { format_text(\"project##{subproject.id}\") }\n+\n+        it { is_expected.to eq(\"<p>#{link_to(subproject.name, project_url, class: 'project')}</p>\") }\n+      end\n+\n+      context 'Plain project link via identifier' do\n+        subject { format_text(\"project:#{subproject.identifier}\") }\n+\n+        it { is_expected.to eq(\"<p>#{link_to(subproject.name, project_url, class: 'project')}</p>\") }\n+      end\n+\n+      context 'Plain project link via name' do\n+        subject { format_text(\"project:\\\"#{subproject.name}\\\"\") }\n+\n+        it { is_expected.to eq(\"<p>#{link_to(subproject.name, project_url, class: 'project')}</p>\") }\n+      end\n+    end\n+\n+    context 'Url links' do\n+      subject { format_text('http://foo.bar/FAQ#3') }\n+\n+      it { is_expected.to eq('<p><a class=\"external\" href=\"http://foo.bar/FAQ#3\">http://foo.bar/FAQ#3</a></p>') }\n+    end\n+\n+    context 'Wiki links' do\n+      let(:project_2) {\n+        FactoryGirl.create :valid_project,\n+                           identifier: 'onlinestore'\n+      }\n+      let(:wiki_1) {\n+        FactoryGirl.create :wiki,\n+                           start_page: 'CookBook documentation',\n+                           project: project\n+      }\n+      let(:wiki_page_1_1) {\n+        FactoryGirl.create :wiki_page_with_content,\n+                           wiki: wiki_1,\n+                           title: 'CookBook_documentation'\n+      }\n+      let(:wiki_page_1_2) {\n+        FactoryGirl.create :wiki_page_with_content,\n+                           wiki: wiki_1,\n+                           title: 'Another page'\n+      }\n+\n+      before do\n+        project_2.reload\n+\n+        wiki_page_2_1 = FactoryGirl.create :wiki_page_with_content,\n+                                           wiki: project_2.wiki,\n+                                           title: 'Start_page'\n+\n+        project_2.wiki.pages << wiki_page_2_1\n+        project_2.wiki.start_page = 'Start Page'\n+        project_2.wiki.save!\n+\n+        project.wiki = wiki_1\n+\n+        wiki_1.pages << wiki_page_1_1\n+        wiki_1.pages << wiki_page_1_2\n+      end\n+\n+      context 'Plain wiki link' do\n+        subject { format_text('[[CookBook documentation]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/#{project.identifier}/wiki/CookBook_documentation\\\" class=\\\"wiki-page\\\">CookBook documentation</a></p>\") }\n+      end\n+\n+      context 'Plain wiki page link' do\n+        subject { format_text('[[Another page|Page]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/#{project.identifier}/wiki/Another_page\\\" class=\\\"wiki-page\\\">Page</a></p>\") }\n+      end\n+\n+      context 'Wiki link with anchor' do\n+        subject { format_text('[[CookBook documentation#One-section]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/#{project.identifier}/wiki/CookBook_documentation#One-section\\\" class=\\\"wiki-page\\\">CookBook documentation</a></p>\") }\n+      end\n+\n+      context 'Wiki page link with anchor' do\n+        subject { format_text('[[Another page#anchor|Page]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/#{project.identifier}/wiki/Another_page#anchor\\\" class=\\\"wiki-page\\\">Page</a></p>\") }\n+      end\n+\n+      context 'Wiki link to an unknown page' do\n+        subject { format_text('[[Unknown page]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/#{project.identifier}/wiki/Unknown_page\\\" class=\\\"wiki-page new\\\">Unknown page</a></p>\") }\n+      end\n+\n+      context 'Wiki page link to an unknown page' do\n+        subject { format_text('[[Unknown page|404]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/#{project.identifier}/wiki/Unknown_page\\\" class=\\\"wiki-page new\\\">404</a></p>\") }\n+      end\n+\n+      context \"Link to another project's wiki\" do\n+        subject { format_text('[[onlinestore:]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/onlinestore/wiki\\\" class=\\\"wiki-page\\\">onlinestore</a></p>\") }\n+      end\n+\n+      context \"Link to another project's wiki with label\" do\n+        subject { format_text('[[onlinestore:|Wiki]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/onlinestore/wiki\\\" class=\\\"wiki-page\\\">Wiki</a></p>\") }\n+      end\n+\n+      context \"Link to another project's wiki page\" do\n+        subject { format_text('[[onlinestore:Start page]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/onlinestore/wiki/Start_page\\\" class=\\\"wiki-page\\\">Start page</a></p>\") }\n+      end\n+\n+      context \"Link to another project's wiki page with label\" do\n+        subject { format_text('[[onlinestore:Start page|Text]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/onlinestore/wiki/Start_page\\\" class=\\\"wiki-page\\\">Text</a></p>\") }\n+      end\n+\n+      context 'Link to an unknown wiki page in another project' do\n+        subject { format_text('[[onlinestore:Unknown page]]') }\n+\n+        it { is_expected.to eq(\"<p><a href=\\\"/projects/onlinestore/wiki/Unknown_page\\\" class=\\\"wiki-page new\\\">Unknown page</a></p>\") }\n+      end\n+\n+      context 'Struck through link to wiki page' do\n+        subject { format_text('-[[Another page|Page]]-') }\n+\n+        it { is_expected.to eql(\"<p><del><a href=\\\"/projects/#{project.identifier}/wiki/Another_page\\\" class=\\\"wiki-page\\\">Page</a></del></p>\") }\n+      end\n+\n+      context 'Named struck through link to wiki page' do\n+        subject { format_text('-[[Another page|Page]] link-') }\n+\n+        it { is_expected.to eql(\"<p><del><a href=\\\"/projects/#{project.identifier}/wiki/Another_page\\\" class=\\\"wiki-page\\\">Page</a> link</del></p>\") }\n+      end\n+\n+      context 'Escaped link to wiki page' do\n+        subject { format_text('![[Another page|Page]]') }\n+\n+        it { is_expected.to eql('<p>[[Another page|Page]]</p>') }\n+      end\n+\n+      context 'Link to wiki of non-existing project' do\n+        subject { format_text('[[unknowproject:Start]]') }\n+\n+        it { is_expected.to eql('<p>[[unknowproject:Start]]</p>') }\n+      end\n+\n+      context 'Link to wiki page of non-existing project' do\n+        subject { format_text('[[unknowproject:Start|Page title]]') }\n+\n+        it { is_expected.to eql('<p>[[unknowproject:Start|Page title]]</p>') }\n+      end\n+    end\n+\n+    context 'Redmine links' do\n+      let(:repository) do\n+        FactoryGirl.build_stubbed :repository, project: project\n+      end\n+      let(:source_url) do\n+        { controller: 'repositories',\n+          action: 'entry',\n+          project_id: identifier,\n+          path: 'some/file' }\n+      end\n+      let(:source_url_with_ext) do\n+        { controller: 'repositories',\n+          action: 'entry',\n+          project_id: identifier,\n+          path: 'some/file.ext' }\n+      end\n+\n+      before do\n+        allow(project).to receive(:repository).and_return(repository)\n+        allow(User).to receive(:current).and_return(project_member)\n+        allow(project_member)\n+          .to receive(:allowed_to?)\n+          .with(:browse_repository, project)\n+          .and_return(true)\n+\n+        @to_test = {\n+          # source\n+          'source:/some/file'           => link_to('source:/some/file', source_url, class: 'source'),\n+          'source:/some/file.'          => link_to('source:/some/file', source_url, class: 'source') + '.',\n+          'source:/some/file.ext.'      => link_to('source:/some/file.ext', source_url_with_ext, class: 'source') + '.',\n+          'source:/some/file. '         => link_to('source:/some/file', source_url, class: 'source') + '.',\n+          'source:/some/file.ext. '     => link_to('source:/some/file.ext', source_url_with_ext, class: 'source') + '.',\n+          'source:/some/file, '         => link_to('source:/some/file', source_url, class: 'source') + ',',\n+          'source:/some/file@52'        => link_to('source:/some/file@52', source_url.merge(rev: 52), class: 'source'),\n+          'source:/some/file.ext@52'    => link_to('source:/some/file.ext@52', source_url_with_ext.merge(rev: 52), class: 'source'),\n+          'source:/some/file#L110'      => link_to('source:/some/file#L110', source_url.merge(anchor: 'L110'), class: 'source'),\n+          'source:/some/file.ext#L110'  => link_to('source:/some/file.ext#L110', source_url_with_ext.merge(anchor: 'L110'), class: 'source'),\n+          'source:/some/file@52#L110'   => link_to('source:/some/file@52#L110', source_url.merge(rev: 52, anchor: 'L110'), class: 'source'),\n+          'export:/some/file'           => link_to('export:/some/file', source_url.merge(format: 'raw'), class: 'source download'),\n+          # escaping\n+          '!source:/some/file'          => 'source:/some/file',\n+          # invalid expressions\n+          'source:'                     => 'source:'\n+        }\n+      end\n+\n+      it '' do\n+        @to_test.each do |text, result|\n+          expect(format_text(text)).to eql(\"<p>#{result}</p>\")\n+        end\n+      end\n+    end\n+\n+    context 'Pre content should not parse wiki and redmine links' do\n+      let(:wiki) {\n+        FactoryGirl.create :wiki,\n+                           start_page: 'CookBook documentation',\n+                           project: project\n+      }\n+      let(:wiki_page) {\n+        FactoryGirl.create :wiki_page_with_content,\n+                           wiki: wiki,\n+                           title: 'CookBook_documentation'\n+      }\n+      let(:raw) {\n+        <<-RAW\n+[[CookBook documentation]]\n+\n+##{issue.id}\n+\n+<pre>\n+[[CookBook documentation]]\n+\n+##{issue.id}\n+</pre>\n+RAW\n+      }\n+\n+      let(:expected) {\n+        <<-EXPECTED\n+<p><a href=\"/projects/#{project.identifier}/wiki/CookBook_documentation\" class=\"wiki-page\">CookBook documentation</a></p>\n+<p><a href=\"/work_packages/#{issue.id}\" class=\"issue work_package status-3 priority-1 created-by-me\" title=\"#{issue.subject} (#{issue.status})\">##{issue.id}</a></p>","path":"spec/lib/open_project/text_formatting_spec.rb","position":605,"original_position":605,"commit_id":"7f1a0ea880fdf4e6d6d0f9782100401b1443d15b","original_commit_id":"7f1a0ea880fdf4e6d6d0f9782100401b1443d15b","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [164/100]","created_at":"2015-06-23T12:17:29Z","updated_at":"2015-06-23T12:17:29Z","html_url":"https://github.com/opf/openproject/pull/3144#discussion_r33034398","pull_request_url":"https://api.github.com/repos/opf/openproject/pulls/3144","_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments/33034398"},"html":{"href":"https://github.com/opf/openproject/pull/3144#discussion_r33034398"},"pull_request":{"href":"https://api.github.com/repos/opf/openproject/pulls/3144"}}},"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/3144","id":37899688,"html_url":"https://github.com/opf/openproject/pull/3144","diff_url":"https://github.com/opf/openproject/pull/3144.diff","patch_url":"https://github.com/opf/openproject/pull/3144.patch","issue_url":"https://api.github.com/repos/opf/openproject/issues/3144","number":3144,"state":"open","locked":false,"title":"[20138] use absolute urls for header linking in ToCs","user":{"login":"floriank","id":498241,"avatar_url":"https://avatars.githubusercontent.com/u/498241?v=3","gravatar_id":"","url":"https://api.github.com/users/floriank","html_url":"https://github.com/floriank","followers_url":"https://api.github.com/users/floriank/followers","following_url":"https://api.github.com/users/floriank/following{/other_user}","gists_url":"https://api.github.com/users/floriank/gists{/gist_id}","starred_url":"https://api.github.com/users/floriank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floriank/subscriptions","organizations_url":"https://api.github.com/users/floriank/orgs","repos_url":"https://api.github.com/users/floriank/repos","events_url":"https://api.github.com/users/floriank/events{/privacy}","received_events_url":"https://api.github.com/users/floriank/received_events","type":"User","site_admin":false},"body":"This will use the absolute URLs to a resource for rendering the anchors. It\r\nprevents the interfering of the Angular router with the Url, leading to\r\nfaulty redirects.\r\n\r\nIt also removes the links when no request is present (in the case of mailers).\r\n\r\nShould meet the requirements of https://community.openproject.org/work_packages/20138","created_at":"2015-06-17T13:23:07Z","updated_at":"2015-06-23T12:17:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6459e68c9c5c6e3a227ade2eda9b3ceb6afa9f4b","assignee":{"login":"floriank","id":498241,"avatar_url":"https://avatars.githubusercontent.com/u/498241?v=3","gravatar_id":"","url":"https://api.github.com/users/floriank","html_url":"https://github.com/floriank","followers_url":"https://api.github.com/users/floriank/followers","following_url":"https://api.github.com/users/floriank/following{/other_user}","gists_url":"https://api.github.com/users/floriank/gists{/gist_id}","starred_url":"https://api.github.com/users/floriank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floriank/subscriptions","organizations_url":"https://api.github.com/users/floriank/orgs","repos_url":"https://api.github.com/users/floriank/repos","events_url":"https://api.github.com/users/floriank/events{/privacy}","received_events_url":"https://api.github.com/users/floriank/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/opf/openproject/pulls/3144/commits","review_comments_url":"https://api.github.com/repos/opf/openproject/pulls/3144/comments","review_comment_url":"https://api.github.com/repos/opf/openproject/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opf/openproject/issues/3144/comments","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/7f1a0ea880fdf4e6d6d0f9782100401b1443d15b","head":{"label":"floriank:fix/20138-toc-links-broken","ref":"fix/20138-toc-links-broken","sha":"7f1a0ea880fdf4e6d6d0f9782100401b1443d15b","user":{"login":"floriank","id":498241,"avatar_url":"https://avatars.githubusercontent.com/u/498241?v=3","gravatar_id":"","url":"https://api.github.com/users/floriank","html_url":"https://github.com/floriank","followers_url":"https://api.github.com/users/floriank/followers","following_url":"https://api.github.com/users/floriank/following{/other_user}","gists_url":"https://api.github.com/users/floriank/gists{/gist_id}","starred_url":"https://api.github.com/users/floriank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floriank/subscriptions","organizations_url":"https://api.github.com/users/floriank/orgs","repos_url":"https://api.github.com/users/floriank/repos","events_url":"https://api.github.com/users/floriank/events{/privacy}","received_events_url":"https://api.github.com/users/floriank/received_events","type":"User","site_admin":false},"repo":{"id":29468662,"name":"openproject","full_name":"floriank/openproject","owner":{"login":"floriank","id":498241,"avatar_url":"https://avatars.githubusercontent.com/u/498241?v=3","gravatar_id":"","url":"https://api.github.com/users/floriank","html_url":"https://github.com/floriank","followers_url":"https://api.github.com/users/floriank/followers","following_url":"https://api.github.com/users/floriank/following{/other_user}","gists_url":"https://api.github.com/users/floriank/gists{/gist_id}","starred_url":"https://api.github.com/users/floriank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floriank/subscriptions","organizations_url":"https://api.github.com/users/floriank/orgs","repos_url":"https://api.github.com/users/floriank/repos","events_url":"https://api.github.com/users/floriank/events{/privacy}","received_events_url":"https://api.github.com/users/floriank/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/floriank/openproject","description":"OpenProject is a web based project management system built on Ruby on Rails","fork":true,"url":"https://api.github.com/repos/floriank/openproject","forks_url":"https://api.github.com/repos/floriank/openproject/forks","keys_url":"https://api.github.com/repos/floriank/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/floriank/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/floriank/openproject/teams","hooks_url":"https://api.github.com/repos/floriank/openproject/hooks","issue_events_url":"https://api.github.com/repos/floriank/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/floriank/openproject/events","assignees_url":"https://api.github.com/repos/floriank/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/floriank/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/floriank/openproject/tags","blobs_url":"https://api.github.com/repos/floriank/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/floriank/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/floriank/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/floriank/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/floriank/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/floriank/openproject/languages","stargazers_url":"https://api.github.com/repos/floriank/openproject/stargazers","contributors_url":"https://api.github.com/repos/floriank/openproject/contributors","subscribers_url":"https://api.github.com/repos/floriank/openproject/subscribers","subscription_url":"https://api.github.com/repos/floriank/openproject/subscription","commits_url":"https://api.github.com/repos/floriank/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/floriank/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/floriank/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/floriank/openproject/issues/comments{/number}","contents_url":"https://api.github.com/repos/floriank/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/floriank/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/floriank/openproject/merges","archive_url":"https://api.github.com/repos/floriank/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/floriank/openproject/downloads","issues_url":"https://api.github.com/repos/floriank/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/floriank/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/floriank/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/floriank/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/floriank/openproject/labels{/name}","releases_url":"https://api.github.com/repos/floriank/openproject/releases{/id}","created_at":"2015-01-19T11:56:20Z","updated_at":"2015-04-20T08:53:16Z","pushed_at":"2015-06-23T12:17:20Z","git_url":"git://github.com/floriank/openproject.git","ssh_url":"git@github.com:floriank/openproject.git","clone_url":"https://github.com/floriank/openproject.git","svn_url":"https://github.com/floriank/openproject","homepage":"https://www.openproject.org","size":69484,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"opf:release/4.2","ref":"release/4.2","sha":"f301b56a92fb518f018318d9b64d3f625715a0b0","user":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"repo":{"id":6899875,"name":"openproject","full_name":"opf/openproject","owner":{"login":"opf","id":1756674,"avatar_url":"https://avatars.githubusercontent.com/u/1756674?v=3","gravatar_id":"","url":"https://api.github.com/users/opf","html_url":"https://github.com/opf","followers_url":"https://api.github.com/users/opf/followers","following_url":"https://api.github.com/users/opf/following{/other_user}","gists_url":"https://api.github.com/users/opf/gists{/gist_id}","starred_url":"https://api.github.com/users/opf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opf/subscriptions","organizations_url":"https://api.github.com/users/opf/orgs","repos_url":"https://api.github.com/users/opf/repos","events_url":"https://api.github.com/users/opf/events{/privacy}","received_events_url":"https://api.github.com/users/opf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opf/openproject","description":"OpenProject is a web-based project management system built on Ruby on Rails","fork":false,"url":"https://api.github.com/repos/opf/openproject","forks_url":"https://api.github.com/repos/opf/openproject/forks","keys_url":"https://api.github.com/repos/opf/openproject/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opf/openproject/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opf/openproject/teams","hooks_url":"https://api.github.com/repos/opf/openproject/hooks","issue_events_url":"https://api.github.com/repos/opf/openproject/issues/events{/number}","events_url":"https://api.github.com/repos/opf/openproject/events","assignees_url":"https://api.github.com/repos/opf/openproject/assignees{/user}","branches_url":"https://api.github.com/repos/opf/openproject/branches{/branch}","tags_url":"https://api.github.com/repos/opf/openproject/tags","blobs_url":"https://api.github.com/repos/opf/openproject/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opf/openproject/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opf/openproject/git/refs{/sha}","trees_url":"https://api.github.com/repos/opf/openproject/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opf/openproject/statuses/{sha}","languages_url":"https://api.github.com/repos/opf/openproject/languages","stargazers_url":"https://api.github.com/repos/opf/openproject/stargazers","contributors_url":"https://api.github.com/repos/opf/openproject/contributors","subscribers_url":"https://api.github.com/repos/opf/openproject/subscribers","subscription_url":"https://api.github.com/repos/opf/openproject/subscription","commits_url":"https://api.github.com/repos/opf/openproject/commits{/sha}","git_commits_url":"https://api.github.com/repos/opf/openproject/git/commits{/sha}","comments_url":"https://api.github.com/repos/opf/openproject/comments{/number}","issue_comment_url":"https://api.github.com/repos/opf/openproject/issues/comments{/number}","contents_url":"https://api.github.com/repos/opf/openproject/contents/{+path}","compare_url":"https://api.github.com/repos/opf/openproject/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opf/openproject/merges","archive_url":"https://api.github.com/repos/opf/openproject/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opf/openproject/downloads","issues_url":"https://api.github.com/repos/opf/openproject/issues{/number}","pulls_url":"https://api.github.com/repos/opf/openproject/pulls{/number}","milestones_url":"https://api.github.com/repos/opf/openproject/milestones{/number}","notifications_url":"https://api.github.com/repos/opf/openproject/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opf/openproject/labels{/name}","releases_url":"https://api.github.com/repos/opf/openproject/releases{/id}","created_at":"2012-11-28T09:59:11Z","updated_at":"2015-06-23T08:29:05Z","pushed_at":"2015-06-23T12:17:22Z","git_url":"git://github.com/opf/openproject.git","ssh_url":"git@github.com:opf/openproject.git","clone_url":"https://github.com/opf/openproject.git","svn_url":"https://github.com/opf/openproject","homepage":"https://www.openproject.org","size":198345,"stargazers_count":640,"watchers_count":640,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":278,"mirror_url":null,"open_issues_count":69,"forks":278,"open_issues":69,"watchers":640,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/opf/openproject/pulls/3144"},"html":{"href":"https://github.com/opf/openproject/pull/3144"},"issue":{"href":"https://api.github.com/repos/opf/openproject/issues/3144"},"comments":{"href":"https://api.github.com/repos/opf/openproject/issues/3144/comments"},"review_comments":{"href":"https://api.github.com/repos/opf/openproject/pulls/3144/comments"},"review_comment":{"href":"https://api.github.com/repos/opf/openproject/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opf/openproject/pulls/3144/commits"},"statuses":{"href":"https://api.github.com/repos/opf/openproject/statuses/7f1a0ea880fdf4e6d6d0f9782100401b1443d15b"}}}}