diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-20 16:49:51 +0300 |
commit | 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch) | |
tree | 6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /lib/kramdown | |
parent | a7253423e3403b8c08f8a161e5937e1488f5f407 (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'lib/kramdown')
-rw-r--r-- | lib/kramdown/converter/commonmark.rb | 2 | ||||
-rw-r--r-- | lib/kramdown/parser/atlassian_document_format.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/kramdown/converter/commonmark.rb b/lib/kramdown/converter/commonmark.rb index a903d541d81..0055558989d 100644 --- a/lib/kramdown/converter/commonmark.rb +++ b/lib/kramdown/converter/commonmark.rb @@ -34,7 +34,7 @@ module Kramdown def convert_codeblock(el, _opts) # Although tildes are supported in CommonMark, backticks are more common "```#{el.options[:lang]}\n" + - el.value.split(/\n/).map { |l| l.empty? ? "" : "#{l}" }.join("\n") + + el.value.split("\n").map { |l| l.empty? ? "" : "#{l}" }.join("\n") + "\n```\n\n" end diff --git a/lib/kramdown/parser/atlassian_document_format.rb b/lib/kramdown/parser/atlassian_document_format.rb index 4ceb879a04c..d27697a59a6 100644 --- a/lib/kramdown/parser/atlassian_document_format.rb +++ b/lib/kramdown/parser/atlassian_document_format.rb @@ -219,7 +219,7 @@ module Kramdown # opportunity to replace it later. Mention name can have # spaces, so double quote it mention_text = ast_node.dig('attrs', 'text')&.gsub('@', '') - mention_text = %Q("#{mention_text}") if mention_text.match?(/ /) + mention_text = %Q("#{mention_text}") if mention_text&.include?(' ') mention_text = %Q(@adf-mention:#{mention_text}) add_text(mention_text, element, :text) |