Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-03-21 17:45:28 +0300
committerVinnie Okada <vokada@mrvinn.com>2015-03-21 17:45:28 +0300
commit1dc90fc455249fb95a47c4abe37c41caeb2ec7da (patch)
treeb526b87164f9975c827ec4f24f99a9c27456ac8f /lib
parentc6dd117c71a326a09a1e6d546d6d0c98a21e3f1d (diff)
Fix nested task lists
When nesting task list items, the parent item is wrapped in a `<p>` tag. Update the task list parser to handle these paragraph wrappers.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb
index e02e5b9fc3d..f5e8267031c 100644
--- a/lib/gitlab/markdown.rb
+++ b/lib/gitlab/markdown.rb
@@ -352,11 +352,12 @@ module Gitlab
# ActiveSupport::SafeBuffer, hence the `String.new`
String.new(text).gsub(Taskable::TASK_PATTERN_HTML) do
checked = $LAST_MATCH_INFO[:checked].downcase == 'x'
+ p_tag = $LAST_MATCH_INFO[:p_tag]
if checked
- "#{li_tag}#{checked_box}"
+ "#{li_tag}#{p_tag}#{checked_box}"
else
- "#{li_tag}#{unchecked_box}"
+ "#{li_tag}#{p_tag}#{unchecked_box}"
end
end
end