Commit Graph

8 Commits

Author SHA1 Message Date
Francisco Javier López f9475e299c Uploads to wiki stored inside the wiki git repository 2018-09-04 10:39:08 +00:00
Nick Thomas 31e5921989
Fix links to uploaded files on wiki pages 2018-01-16 16:11:02 +00:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Timothy Andrew 6d169d36ca Fix bug in `WikiLinkFilter`.
1. An exception would be raised if the filter was called with an invalid
   URI. Mainly because we weren't catching the `Addressable` exception.

2. This commit fixes it and adds a spec for the filter.
2016-06-18 14:10:40 +05:30
Timothy Andrew 8e71c19a69 Implement the correct linking behaviour in `WikiLinkFilter`.
Original Comments
=================

- Linking behaves as per rules documented here:
  https://gitlab.com/gitlab-org/gitlab-ce/blob/16568-document-wiki-linking-behavior/doc/markdown/wiki.md
- All links (to other wiki pages) are rewritten to be at the level of
  the app root. We can't use links relative to the current
  page ('./foo', 'foo', '../foo'), because they won't work in the
  markdown preview, where the current page is suffixed with `/edit`
- Move existing `WikiLinkFilter` specs to `WikiPipeline` spec. It makes
  sense to run these tests on the combined output of the pipeline,
  rather than a single filter, since we can catch issues with
  conflicting filters.
- Add more tests to cover the new linking

@rymai's Review
===============

- Classes nested under `WikiLinkFilter` should declare `WikiLinkFilter`'s
  inherit, so nothing changes if the nested class is loaded first.
- Add a blank line after a guard clause
- Use keyword arguments for the `Rewriter` constructor
- Invert a condition - use `if` instead of `unless`
- Inline a `let` in `WikiPipeline` spec - it was only used in a single place
- Change out of date spec names
- Add a comment for every rewrite rule in `Rewriter`
2016-06-09 10:04:15 +05:30
Timothy Andrew a4ee7d25e3 Implement @rymai's feedback after review.
- Separate 'exercise' and 'verify' steps of tests.
- Use `build_stubbed` instead of `build`
2016-05-12 07:17:07 +05:30
Timothy Andrew a59ad3936a Add a spec for `WikiLinkFilter`
- And fix behavior for non-file hierarchical links.
2016-05-12 07:17:07 +05:30