From 96d49bf04ce77c975fe500f4d961e4a1ffed4c26 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 30 Dec 2012 14:43:00 +0200 Subject: Use sdoc to generate application code documentation --- doc/code/classes/GitlabMarkdownHelper.html | 222 +++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 doc/code/classes/GitlabMarkdownHelper.html (limited to 'doc/code/classes/GitlabMarkdownHelper.html') diff --git a/doc/code/classes/GitlabMarkdownHelper.html b/doc/code/classes/GitlabMarkdownHelper.html new file mode 100644 index 00000000000..32ae5f822b5 --- /dev/null +++ b/doc/code/classes/GitlabMarkdownHelper.html @@ -0,0 +1,222 @@ + + + + + GitlabMarkdownHelper + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
Methods
+
+ +
L
+
+ +
+ +
M
+
+ +
+ +
+ + + + +
Included Modules
+ + + + + + + + + + + + + + + + + + + +
Instance Public methods
+ +
+ + + +
+

Use this in places where you would normally use link_to(gfm(…), …).

+ +

It solves a problem occurring with nested links (i.e. “<a>outer text +<a>gfm ref</a> more outer text</a>”). This will not be +interpreted as intended. Browsers will parse something like “<a>outer +text </a><a>gfm ref</a> more outer text” (notice the last +part is not linked any more). #link_to_gfm +corrects that. It wraps all parts to explicitly produce the correct linking +behavior (i.e. “<a>outer text </a><a>gfm +ref</a><a> more outer text</a>”).

+
+ + + + + + +
+ + + +
+ +
+ +
+
+ + markdown(text) + + +
+ + +
+ +
+ + + + + + +
+ + +
+
# File app/helpers/gitlab_markdown_helper.rb, line 25
+def markdown(text)
+  unless @markdown
+    gitlab_renderer = Redcarpet::Render::GitlabHTML.new(self,
+                        # see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch-
+                        filter_html: true,
+                        with_toc_data: true,
+                        hard_wrap: true)
+    @markdown = Redcarpet::Markdown.new(gitlab_renderer,
+                    # see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
+                    no_intra_emphasis: true,
+                    tables: true,
+                    fenced_code_blocks: true,
+                    autolink: true,
+                    strikethrough: true,
+                    lax_html_blocks: true,
+                    space_after_headers: true,
+                    superscript: true)
+  end
+
+  @markdown.render(text).html_safe
+end
+
+
+ +
+
+ +
+ + \ No newline at end of file -- cgit v1.2.1