Commit Graph

109 Commits

Author SHA1 Message Date
Robert Speicher f833726ec0 Remove `random_markdown_tip` helper
Only usage got removed in !3442
2016-04-09 20:43:59 -04:00
Robert Speicher 74751791a8 Add a PreProcessPipeline 2016-03-02 22:19:36 -05:00
Ben Boeckel e919b5a4e9 Fix relative links in other markup formats
- 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.
2016-02-12 17:20:59 +01:00
Douglas Barbosa Alexandre 4872b319c8 Use the WikiPipeline when rendering the wiki markdown content 2016-01-14 12:09:31 -02:00
Dmitriy Zaporozhets 40104746d6 Merge remote-tracking branch 'origin/feature/update-rubocop' 2015-12-16 13:44:50 +01:00
Douwe Maan 7781bda9bd Move Markdown/reference logic from Gitlab::Markdown to Banzai 2015-12-15 15:51:16 +01:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Douwe Maan f5a630111f Merge branch 'master' into reference-pipeline-and-caching 2015-11-19 15:46:04 +01:00
Dmitriy Zaporozhets 3cebe9e780
Refactor duplciate code for groups_controller.rb and slack_service/note_message.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-17 11:03:18 +01:00
Dmitriy Zaporozhets 5f23909362
Remove code duplication in gitlab_markdown_helper.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-17 10:40:29 +01:00
Douwe Maan b093cb35d1 Use Gitlab::Markdown for Asciidoc and ReferenceExtractor pipelines 2015-10-14 20:18:49 +02:00
Douwe Maan ed41333a6e Use Gitlab::Markdown.render with :pipeline option rather than different methods 2015-10-14 19:28:09 +02:00
Douwe Maan 5dd77358f6 Pass project to RedactorFilter 2015-10-13 13:36:47 +02:00
Douwe Maan f42cfa9e87 Refactor reference gathering to use a dedicated filter 2015-10-07 17:00:48 +02:00
Douwe Maan 12626f029d Return strings where expected 2015-10-07 15:22:28 +02:00
Douwe Maan 4f629dab2a Merge branch 'master' into rs-redactor-filter 2015-10-07 15:15:35 +02:00
SAKATA Sinji a3c6ed5c46 Fix link with emoji 2015-10-02 01:26:19 +09:00
Stan Hu a7b0ee3fd1 Fix cases where Markdown did not render links in activity feed
HTML would be stripped in `truncate_if_block` when a comment had multiple lines
and the first wasn't long enough to be truncated. The use of `node.content` would
strip all HTML tags. Using `node.inner_html` retains these tags and puts the
"..." in between paragraph tags.

Closes #2586
2015-09-22 21:56:27 -07:00
Stan Hu 3b39b648d2 Fix Markdown links not showing up in dashboard activity feed
Closes #2586
2015-09-20 09:32:35 -07:00
Robert Speicher 3b690891f3 Basic support for an Atom-specific rendering pipeline 2015-09-03 17:47:15 -04:00
Robert Speicher 4bd92e681e Return early from markdown and gfm when text is empty 2015-09-03 16:38:35 -04:00
Robert Speicher 5794d65a07 Add post_process method to Gitlab::Markdown 2015-09-01 18:16:56 -04:00
Robert Speicher 81fc63bec0 Remove `current_user` context from markdown and gfm helpers
These helpers are no longer dependent on the current user state. Hooray!
2015-09-01 17:59:09 -04:00
Robert Speicher 1bcfe4d2ff Remove PreferencesHelper include from GitlabMarkdownHelper 2015-09-01 13:37:05 -04:00
Robert Speicher 2930041886 Make sure the `gfm` helper passes the required options
This adds some duplication, but this helper is temporary.
2015-08-31 18:09:18 -04:00
Robert Speicher 90ab92621f Make `gfm` delegate to `Gitlab::Markdown.gfm` instead of `markdown`
Some usages of the `gfm` helper depend on the text not being rendered as
standard Markdown. Ugh.
2015-08-31 16:16:26 -04:00
Robert Speicher 7816b22360 Fix context options in `markdown` helper
We need to send `path`, not `requested_path`.
2015-08-31 16:16:03 -04:00
Robert Speicher 62117becb9 Add a temporary `gfm` helper that just delegates to `markdown`
Some views are still calling `gfm` directly. We'll need to update them
to instead call `markdown` with a `pipeline: ...` argument.
2015-08-27 15:36:56 -07:00
Robert Speicher a4e4fde3e6 Restore the forwarded HTML options in link_to_gfm 2015-08-27 14:28:45 -07:00
Robert Speicher 4340dd3eeb Decouple Gitlab::Markdown from the GitlabMarkdownHelper
This module is now the sole source of knowledge for *how* we render
Markdown (and GFM).
2015-08-27 14:17:26 -07:00
Robert Speicher 2c3e42e4a4 Remove user_color_scheme_class
Instead of rendering this value server-side, we use Javascript and Gon
to apply the user's color scheme (or the default) to any syntax
highlighted code blocks.

This will make it easier to cache these blocks in the future because
they're no longer state-dependent.
2015-08-25 15:32:38 -07:00
Darby 360ee25ddb Fixed the issues 2015-07-09 13:38:33 -07:00
Darby c611b6f623 Comment box/Placeholder text redo 2015-07-01 15:49:31 -07:00
Robert Speicher 09f2bec64c Prefix random Markdown tips with "Tip:" 2015-06-24 18:43:57 -04:00
Robert Speicher 82a671704d Show a random Markdown tip in the textarea placeholder 2015-06-23 21:00:10 -04:00
Robert Speicher 8112f7550b Add PreferencesHelper module
Consolidates the helpers related to user preferences.

Renames `app_theme` to `user_application_theme` to better explain what
it is.
2015-06-13 17:58:16 -04:00
Douwe Maan fe78984f20 Actually ignore references in code blocks etc. 2015-06-02 13:17:11 +02:00
Robert Speicher 5733bdb7c7 Fix link_to_gfm with only a reference having the incorrect link
Closes #1721
2015-05-29 04:46:14 -04:00
Robert Speicher 38fb6279f9 Simplify `cross_project_reference` with `to_reference` 2015-05-26 15:48:31 -04:00
Jakub Jirutka 8dbc4746fe Handle AsciiDoc better, reuse HTML pipeline filters (fixes #9263) 2015-05-18 20:48:03 +02:00
Douwe Maan cd52cef1c0 Fix reference links in dashboard activity and ATOM feeds. 2015-05-14 13:05:33 +02:00
Jakub Jirutka f7adac87fe Extract handling of relative file links to RelativeLinkFilter 2015-05-11 02:07:26 +02:00
Robert Speicher e46d1cdd8b Add Gitlab::Markdown::SanitizationFilter
This just extends the HTML::Pipeline::SanitizationFilter with our custom
whitelist.
2015-04-30 16:35:25 -04:00
Robert Speicher aa2cc670fe Add Gitlab::Markdown::AutolinkFilter 2015-04-30 16:35:25 -04:00
Robert Speicher 382a0aa6ef Add Gitlab::Markdown::TableOfContentsFilter
Removes header and table of contents processing from Redcarpet renderer.
2015-04-30 16:35:25 -04:00
Guillaume Delbergue 5f2e8b6147 Add footnotes support to Markdown
Signed-off-by: Guillaume Delbergue <guillaume.delbergue@greensocs.com>
2015-04-24 10:00:31 +02:00
Robert Speicher f76df89058 Begin cleaning out spec/helpers/gitlab_markdown_helper_spec 2015-04-20 13:01:44 -04:00
Douwe Maan 0ece6bd828 Use `\A` and `\z` in regexes instead of `^` and `$`. 2015-04-10 18:31:07 +02:00
Robert Speicher 13313d9e31 Disable RedCarpet's `escape_html` option
This option defaults to true in RedCarpet 3.2.0, but we handle
sanitization later in the process with html-pipeline.

Closes #2211
2015-04-09 17:28:45 -04:00
Dmitriy Zaporozhets 6199da0cb4 Merge pull request #8007 from mr-vinn/markdown-tags
Allow HTML tags in user Markdown input
2015-03-25 10:21:03 -07:00