Sfoglia il codice sorgente

:octocat: HTML output: add "class" attribute only when $cssClass is non-empty

codemasher 5 anni fa
parent
commit
93d006cf6b
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      src/Output/QRMarkup.php

+ 6 - 1
src/Output/QRMarkup.php

@@ -54,7 +54,12 @@ class QRMarkup extends QROutputAbstract{
 	 * HTML output
 	 * HTML output
 	 */
 	 */
 	protected function html():string{
 	protected function html():string{
-		$html = '<div class="'.$this->options->cssClass.'">'.$this->options->eol;
+
+		$html = empty($this->options->cssClass)
+			? '<div>'
+			: '<div class="'.$this->options->cssClass.'">';
+
+		$html .= $this->options->eol;
 
 
 		foreach($this->matrix->matrix() as $row){
 		foreach($this->matrix->matrix() as $row){
 			$html .= '<div>';
 			$html .= '<div>';