summaryrefslogtreecommitdiff
path: root/lib/banzai
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'dev_issue_15331' into 'master' Robert Speicher2016-04-211-3/+2
|\ | | | | | | | | | | | | | | | | Fixes window.opener bug Adds `noreferrer` value to rel attribute for external links REF: https://gitlab.com/gitlab-org/gitlab-ce/issues/15331 See merge request !1953
| * Fix failing specAlfredo Sumaran2016-04-211-2/+1
| |
| * Add noreferrer value to rel attribute for external linksAlfredo Sumaran2016-04-201-1/+1
| |
* | Refactor banzai code that finds cross-project labelsGrzegorz Bizon2016-04-211-15/+21
| |
* | Fix cross-project label ref with invalid projectGrzegorz Bizon2016-04-211-1/+1
|/ | | | Closes #15168
* Instrument Banzai codeYorick Peterse2016-04-111-8/+12
|
* Merge branch 'patch/fix-markdown-preview-wikis' into 'master' Robert Speicher2016-04-073-6/+70
|\ | | | | | | | | | | | | | | | | | | | | Wiki preview URL converting problem [via Markdown] Current implementation when rendering the preview, thinks relative links are for project repository files. We are creating a new preview route that will define correct context data to render for wikis instead. Fixes #2380, #1184 See merge request !3461
| * little refactor and improvements on specsGabriel Mazetto2016-04-061-6/+2
| |
| * Ensure correct filter order to validate with our markdown specpatch/fix-markdown-preview-wikisGabriel Mazetto2016-04-062-3/+7
| |
| * Fix a few edited references from WikiLinkFilter and specsGabriel Mazetto2016-04-061-2/+6
| |
| * Fixed WikiPipeline and specsGabriel Mazetto2016-04-061-1/+1
| |
| * Added WikiLinkFilterGabriel Mazetto2016-04-012-2/+56
| |
| * Fixed Gollum pages link url expansion to render correctly in previewGabriel Mazetto2016-03-301-3/+9
| |
* | Fix header link rendering when containing numbersfix-markdown-renderingYorick Peterse2016-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | This fixes the problem where Markdown such as: ### 31st Would get rendered as a link tag pointing to issue number 31 inside a header tag. See gitlab-org/gitlab-ce#14936 for more information.
* | Wrap images in discussions and wikis with a link to the image source using ↵connorshea2016-04-042-0/+28
| | | | | | | | | | | | | | | | ImageLinkFilter. Resolves #14411. See merge request !3464
* | Cleaned up caching in AbstractReferenceFilterYorick Peterse2016-04-041-15/+11
| | | | | | | | | | Cleaning this up any further is a bit tricky as the caches in question should only be evaluated if RequestStore is actually enabled.
* | Cache default_issues_tracker? in BanzaiYorick Peterse2016-04-041-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every object processed by ExternalIssueReferenceFilter can return a different Project instance when calling "project". For example, every note processed will have it's own associated Project. If we were to cache Project#default_issues_tracker? on Project level this would have no impact on Markdown rendering timings as the cache would have to be built for every Project instance without it ever being re-used. To work around this we cache Project#default_issues_tracker? in Banzai::Filter::ExternalIssueReferenceFilter using the project's _id_ instead of the whole object. This setup allows re-using of the cached data even when the Project instances used are different, as long as the actual project IDs are the same.
* | Memoize object class titlesYorick Peterse2016-04-041-1/+9
| | | | | | | | | | For an issue with around 200 notes this cuts down timings by around 150 milliseconds.
* | Cache Banzai class methods returning static dataYorick Peterse2016-04-041-3/+3
| | | | | | | | | | These methods always return the same data for every class so there's no point in computing their values on every call.
* | Refactor processing of various Banzai filtersYorick Peterse2016-04-044-134/+120
| | | | | | | | | | | | | | These filters now use a single iteration over all the document nodes instead of multiple ones. This in turn allows variables to be re-used (e.g. links only have to be unescaped once). Combined with some other refactoring this can drastically reduce render timings.
* | Cache Banzai projects/objects using RequestStoreYorick Peterse2016-04-041-4/+67
| | | | | | | | | | | | | | | | | | | | This was originally suggested by @ayufan and modified to be a bit cleaner and use RequestStore instead of a regular Hash. By caching the output of the two methods involved the number of queries is reduced significantly. For example, for an issue with 200 notes (of which 100 reference a number of merge requests) this cuts down the amount of queries from around 6300 to around 3300.
* | Added & use Gitlab::Routing for URL helpersroutingYorick Peterse2016-04-017-7/+7
|/ | | | | | | Rails' "url_helpers" method creates an anonymous Module (which a bunch of methods) on every call. By caching the output of this method in a dedicated method we can shave off about 10 seconds of loading time for an issue with around 200 comments.
* Remove redundant `require`s from Banzai filesrs-banzai-requiresRobert Speicher2016-03-2418-38/+0
| | | | We're trying to avoid circular dependency errors.
* Merge branch 'master' into feature/issue-moveGrzegorz Bizon2016-03-191-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (121 commits) Dedupe labels in labels selector in Dashboard pages Refactor colors and lists Add a safeguard in MergeRequest#compute_diverged_commits_count Fix an issue when the target branch of a MR had been deleted Add avatar to issue and MR pages header Cleanup somce css colors Re-group scss variables Refactor `Todo#target` Fixes issue with filter label missing on labels & milestones Rename `Todo#to_reference` to `Todo#target_reference` Fixed failing tests Updated controller with before_action Fixed other issues based on feedback Fixes issue on dashboard issues Full labels data in JSON Fixed issue with labels dropdown getting wrong labels Update CHANGELOG Use `Note#for_project_snippet?` to skip notes on project snippet Use `Commit#short_id` instead of `Commit.truncate_sha` Reuse `for_commit?` on conditional validations Update schema info comment on todo related files ... Conflicts: app/models/issue.rb db/schema.rb spec/models/issue_spec.rb
| * Restrict access to references for confidential issuesDouglas Barbosa Alexandre2016-03-171-0/+5
| |
* | Add implementation of reference unfolder using banzaiGrzegorz Bizon2016-03-171-0/+1
| |
* | Move reference unfolder for GFM to separate classGrzegorz Bizon2016-03-172-63/+0
| |
* | Do not unfold non-referables when moving an issueGrzegorz Bizon2016-03-171-0/+2
| |
* | Use internal reference extractor in banzai unfold pipelineGrzegorz Bizon2016-03-172-21/+27
| |
* | Add reference unfold pipeline used when moving issueGrzegorz Bizon2016-03-172-0/+55
|/
* Be more intelligent about sanitizing links with unsafe protocolsrs-issue-14220Robert Speicher2016-03-141-2/+7
| | | | | | | This prevents false matches on relative links like `[database](database.md)`. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/14220
* Merge branch 'feature/cross-project-labels' into 'master' Douwe Maan2016-03-072-55/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for cross project references for labels ## Summary Support for cross project references for labels. ## Rationale 1. Cross project label references are currently not supported in GitLab 1. `to_reference` method signature in `Label` model breaks the abstraction introduced in `Referable`. `concerns/referable.rb: def to_reference(_from_project = nil)` Signatures: ``` label.rb: def to_reference(format = :id) commit_range.rb: def to_reference(from_project = nil) commit.rb: def to_reference(from_project = nil) external_issue.rb: def to_reference(_from_project = nil) group.rb: def to_reference(_from_project = nil) issue.rb: def to_reference(from_project = nil) merge_request.rb: def to_reference(from_project = nil) milestone.rb: def to_reference(from_project = nil) project.rb: def to_reference(_from_project = nil) snippet.rb: def to_reference(from_project = nil) user.rb: def to_reference(_from_project = nil) ``` This MR suggests using `def to_reference(from_project = nil, format: :id)` which makes use of keyword arguments and preserves abstract interface. 1. We need support for cross project label references when we want to move issue to another project It may happen that issue description, system notes or comments contain reference to label and this reference will be invalid after moving issue to another project and will not be displayed correctly unless we have support for cross project references. Merge request that needs this feature: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2831 I think that cross project label references may be useful, (example: `Hey, see our issues for CI in GitLab CE! - gitab-org/gitlab-ce~"CI"`). cc @JobV @DouweM @rspeicher See merge request !2966
| * Remove redundant code in cross project labels implementationGrzegorz Bizon2016-03-031-4/+0
| |
| * Add additional text prefix in cross project labelsGrzegorz Bizon2016-03-031-2/+6
| |
| * Add support for cross project references for labelsGrzegorz Bizon2016-03-031-54/+23
| |
| * Fix bug with return value in abstract reference filterGrzegorz Bizon2016-03-031-0/+2
| | | | | | | | | | | | | | When `object_class.link_reference_pattern` was `nil` because object being processed do not implemement link references `call` method returned `nil` instead of returning document, even if document has been processed in for basic reference pattern.
* | Merge branch 'rs-frontmatter-pre' into 'master' Robert Speicher2016-03-053-0/+51
|\ \ | | | | | | | | | | | | Properly display YAML front matter in Markdown See merge request !3072
| * | Add YamlFrontMatterFilter to the PreProcessPipelineRobert Speicher2016-03-042-1/+30
| | | | | | | | | | | | | | | This filter will detect YAML Front Matter and convert it to an HTML table for prettier formatting.
| * | Add a PreProcessPipelineRobert Speicher2016-03-022-0/+22
| |/
* | Merge branch 'rs-wiki-pipeline-spec' into 'master' Douwe Maan2016-03-041-3/+5
|\ \ | |/ |/| | | | | | | | | | | 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. See merge request !3054
| * Replace `[[_TOC_]]` tag even if `toc` result is blankrs-wiki-pipeline-specRobert Speicher2016-03-031-3/+5
| |
* | Add FilterArray class to Banzairs-filter-arrayRobert Speicher2016-03-0110-13/+37
|/
* Merge branch 'rs-wiki-toc' into 'master' Douwe Maan2016-03-012-8/+33
|\ | | | | | | | | | | | | Replace Gollum `[[_TOC_]]` tag with result of TableOfContentsFilter Closes #2494 See merge request !2952
| * Replace Gollum `[[_TOC_]]` tag with result of TableOfContentsFilterrs-wiki-tocRobert Speicher2016-02-232-8/+33
| | | | | | | | Closes #2494
* | Sanitize `vbscript:` linksrs-data-linksRobert Speicher2016-02-231-1/+3
| | | | | | | | Closes https://dev.gitlab.org/gitlab/gitlabhq/issues/2660
* | Sanitize `data:` linksRobert Speicher2016-02-211-4/+4
|/ | | | Closes #13625
* Merge branch 'rs-emoji' into 'master' Douwe Maan2016-02-191-1/+2
|\ | | | | | | | | | | | | | | | | Update Gemojione for new hotness :sparkles: Before | After ------ | ----- ![Screen_Shot_2016-02-12_at_3.38.43_PM](/uploads/299e5ffe38c91657085741261a678f81/Screen_Shot_2016-02-12_at_3.38.43_PM.png) | ![Screen_Shot_2016-02-12_at_3.38.09_PM](/uploads/ccee29719a6445a9efd2498391a7eea0/Screen_Shot_2016-02-12_at_3.38.09_PM.png) See merge request !2800
| * Update Emoji asset pathRobert Speicher2016-02-121-1/+2
| | | | | | | | | | Now that we're serving assets directly from the Gemojione gem's path, the images are not in an `emoji/` sub-folder.
* | Fix relative links in other markup formatsben.boeckel/gitlab-ce-fixup-links-in-generic-docsBen Boeckel2016-02-121-11/+0
|/ | | | | | | | - Apply the RelativeLinkFilter filter to other formats, e.g., reStructuredText so links from the Files view or the Project view work - Remove the AsciidocPipeline pipeline Fixes #3533.
* Allow limited Markdown in Broadcast Messagesrs-broadcast-markdownRobert Speicher2016-02-061-0/+16
| | | | Closes #11853