Skip to content

Commit f7cd6d5

Browse files
Add Handling for font names in double quotes
1 parent 2014b0b commit f7cd6d5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Html/Font.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ class Font
1111

1212
public function toStyle(): string {
1313
$list = array();
14+
// If the name is in double quotes replace them with single quotes
15+
if($this->name) $this->name = preg_replace("/^\"(.*)\"$/", '\'$1\'', $this->name);
1416
if($this->name) array_push($list, $this->name);
1517
if($this->family) array_push($list, $this->family);
1618
if(sizeof($list) == 0) return "";
17-
return "font-family:" . join(' ', $list) . ";";
19+
return "font-family:" . join(', ', $list) . ";";
1820
}
1921
}
22+

0 commit comments

Comments
 (0)