Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jekyll-mentions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Mentions
GITHUB_DOT_COM = "https://github.com"
BODY_START_TAG = "<body"

OPENING_BODY_TAG_REGEX = %r!<body(.*?)>\s*!.freeze
OPENING_BODY_TAG_REGEX = %r!<body(.*?)>\s*!m.freeze

InvalidJekyllMentionConfig = Class.new(Jekyll::Errors::FatalException)

Expand Down
14 changes: 14 additions & 0 deletions spec/fixtures/_layouts/multiline_body_tag.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>{{ page.title }}</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="/css/screen.css">
</head>
<body
class="wrap"
>
{{ content }}
</body>
</html>
6 changes: 6 additions & 0 deletions spec/fixtures/multiline-body-tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
layout: multiline_body_tag
title: Multi-line Body Tag
---

test @TestUser test
4 changes: 4 additions & 0 deletions spec/mentions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def para(content)
)
end

it "works with HTML body tag markup across multiple lines" do
expect(find_by_title(site.pages, "Multi-line Body Tag").output).to include(para(result))
end

context "when jekyll-mentions is set to false" do
it "should not replace the @TestUser with the link to @TestUser" do
expect(disabled_mentioning_page.output).not_to include(result)
Expand Down