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
99 GITHUB_DOT_COM_ASSET_HOST_URL = "https://github.githubassets.com"
1010 ASSET_PATH = "/images/icons/"
1111 BODY_START_TAG = "<body"
12- OPENING_BODY_TAG_REGEX = %r!<body(.*?)>\s *! . freeze
12+ OPENING_BODY_TAG_REGEX = %r!<body(.*?)>\s *!m . freeze
1313
1414 class << self
1515 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://github.githubassets.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 3636 let ( :plain_index ) { site . pages . find { |page | page [ "title" ] == "Plain Jemoji" } }
3737 let ( :plain_minified ) { site . pages . find { |page | page [ "title" ] == "Plain Jemoji Minified" } }
3838
39+ let ( :multiline_body_tag ) { site . pages . find { |page | page [ "title" ] == "Multi-line Body Tag" } }
40+
3941 let ( :basic_doc ) { find_by_title ( site . collections [ "docs" ] . docs , "File" ) }
4042 let ( :doc_with_liquid ) { find_by_title ( site . collections [ "docs" ] . docs , "With Liquid" ) }
4143 let ( :txt_doc ) { find_by_title ( site . collections [ "docs" ] . docs , "Don't Touch Me" ) }
@@ -102,6 +104,10 @@ def para(content)
102104 expect ( plain_minified . output ) . to eql ( fixture ( "minified_index_without_body_attributes.html" ) )
103105 end
104106
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+
105111 context "with a different base for jemoji" do
106112 let ( :emoji_src ) { "http://mine.club/" }
107113 let ( :config_overrides ) do
You can’t perform that action at this time.
0 commit comments