File tree Expand file tree Collapse file tree 5 files changed +37
-1
lines changed Expand file tree Collapse file tree 5 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Emoji
9
9
GITHUB_DOT_COM_ASSET_HOST_URL = "https://assets-git.f3mw1.com"
10
10
ASSET_PATH = "/images/icons/"
11
11
BODY_START_TAG = "<body"
12
- OPENING_BODY_TAG_REGEX = %r!<body(.*?)>\s *! . freeze
12
+ OPENING_BODY_TAG_REGEX = %r!<body(.*?)>\s *!m . freeze
13
13
14
14
class << self
15
15
def emojify ( doc )
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout: base
3
+ ---
4
+
5
+ < body
6
+ class ="wrap "
7
+ >
8
+ {{ content }}
9
+ </ body >
Original file line number Diff line number Diff line change
1
+ ---
2
+ layout : multiline_body_tag
3
+ title : Multi-line Body Tag
4
+ ---
5
+ :+1 :
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE HTML>
2
+ < html lang ="en-US ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < title > Multi-line Body Tag</ title >
6
+ < meta name ="viewport " content ="width=device-width,initial-scale=1 ">
7
+ < link rel ="stylesheet " href ="/css/screen.css ">
8
+ </ head >
9
+ < body
10
+ class ="wrap "
11
+ >
12
+ < p > < img class ="emoji " title =":+1: " alt =":+1: " src ="https://assets-git.f3mw1.com/images/icons/emoji/unicode/1f44d.png " height ="20 " width ="20 "> </ p >
13
+
14
+ </ body >
15
+
16
+ </ html >
Original file line number Diff line number Diff line change 36
36
let ( :plain_index ) { site . pages . find { |page | page [ "title" ] == "Plain Jemoji" } }
37
37
let ( :plain_minified ) { site . pages . find { |page | page [ "title" ] == "Plain Jemoji Minified" } }
38
38
39
+ let ( :multiline_body_tag ) { site . pages . find { |page | page [ "title" ] == "Multi-line Body Tag" } }
40
+
39
41
let ( :basic_doc ) { find_by_title ( site . collections [ "docs" ] . docs , "File" ) }
40
42
let ( :doc_with_liquid ) { find_by_title ( site . collections [ "docs" ] . docs , "With Liquid" ) }
41
43
let ( :txt_doc ) { find_by_title ( site . collections [ "docs" ] . docs , "Don't Touch Me" ) }
@@ -102,6 +104,10 @@ def para(content)
102
104
expect ( plain_minified . output ) . to eql ( fixture ( "minified_index_without_body_attributes.html" ) )
103
105
end
104
106
107
+ it "works with HTML body tag markup across multiple lines" do
108
+ expect ( multiline_body_tag . output ) . to eql ( fixture ( "multiline_body_tag.html" ) )
109
+ end
110
+
105
111
context "with a different base for jemoji" do
106
112
let ( :emoji_src ) { "http://mine.club/" }
107
113
let ( :config_overrides ) do
You can’t perform that action at this time.
0 commit comments