Commit graph

8 commits

Author SHA1 Message Date
Qingping Hou
5c9376f90d Fix URLs with anchors in wiki 2016-09-13 23:53:40 -07:00
Grzegorz Bizon
9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Paco Guzman
be98ee2586
Fixing specs stubbed objects cannot access database 2016-06-10 15:41:56 +02:00
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
Gabriel Mazetto
1575a95b65 little refactor and improvements on specs 2016-04-06 20:09:15 -03:00
Gabriel Mazetto
61fe0a2397 Fixed WikiPipeline and specs 2016-04-06 03:12:39 -03:00
Robert Speicher
def6446dad Replace [[_TOC_]] tag even if toc result is blank 2016-03-03 12:41:40 -05:00
Robert Speicher
82bc6c6229 Add a spec for WikiPipeline
Removes the specs from GollumTagsFilter that were more like integration
tests for the pipeline than unit tests of the filter.
2016-03-01 16:59:56 -05:00