Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 751105c

Browse files
committed
Merge branch 'release-0.6.3'
2 parents 8467664 + 6300b57 commit 751105c

File tree

8 files changed

+21
-13
lines changed

8 files changed

+21
-13
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
22

3+
PL-v0.6.3
4+
- FIX: making sure code view is properly encoded
5+
- THX: thanks to @tylersticka for the heads up
6+
37
PL-v0.6.2
48
- FIX: a few small sass and styling tweaks
59
- THX: thanks to @griffinartworks for the sass and styling fixes

builder/builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Builder CLI - v0.6.2
4+
* Pattern Lab Builder CLI - v0.6.3
55
*
66
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

builder/lib/builder.lib.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Builder Class - v0.6.2
4+
* Pattern Lab Builder Class - v0.6.3
55
*
66
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license
@@ -198,7 +198,7 @@ private function generatePatternFile($f) {
198198
$pp = $this->getPatternPartial($f);
199199
$fr = str_replace("{{ patternPartial }}",$pp,$fr);
200200
$fr = str_replace("{{ lineage }}",json_encode($this->patternLineages[$pp]),$fr);
201-
$fr = str_replace("{{ patternHTML }}",$rf,$fr);
201+
$fr = str_replace("{{ patternHTML }}",htmlentities($rf),$fr);
202202

203203
// set-up the mark-up for CSS Rule Saver so it can figure out which rules to save
204204
if ($this->enableCSS) {
@@ -620,7 +620,8 @@ protected function gatherPartials() {
620620
$patternParts = explode("/",$path);
621621
$patternName = $this->getPatternName($patternParts[2]);
622622
$patternLink = str_replace("/","-",$path)."/".str_replace("/","-",$path).".html";
623-
$patternCode = $this->renderPattern($path.".mustache");
623+
$patternCodeHTML = $this->renderPattern($path.".mustache");
624+
$patternCode = htmlentities($patternCodeHTML);
624625
$patternPartial = $this->getPatternPartial($path);
625626
$patternLineageExists = (count($this->patternLineages[$patternPartial]) > 0) ? true : false;
626627
$patternLineages = $this->patternLineages[$patternPartial];
@@ -630,7 +631,8 @@ protected function gatherPartials() {
630631
$p["partials"][] = array("patternName" => ucwords($patternName),
631632
"patternLink" => $patternLink,
632633
"patternPartialPath" => $patternType."-".$pattern,
633-
"patternPartial" => $patternCode,
634+
"patternCode" => $patternCode,
635+
"patternPartial" => $patternCodeHTML,
634636
"patternCSS" => $patternCSS,
635637
"patternLineageExists" => $patternLineageExists,
636638
"patternLineages" => $patternLineages,
@@ -678,7 +680,8 @@ protected function gatherPartialsByMatch($patternType, $patternSubType) {
678680
// create the pattern name & link, render the partial, and stick it all into the pattern array
679681
$patternName = $this->getPatternName($patternParts[2]);
680682
$patternLink = str_replace("/","-",$path)."/".str_replace("/","-",$path).".html";
681-
$patternCode = $this->renderPattern($path.".mustache");
683+
$patternCodeHTML = $this->renderPattern($path.".mustache");
684+
$patternCode = htmlentities($patternCodeHTML);
682685
$patternPartial = $this->getPatternPartial($path);
683686
$patternLineages = $this->patternLineages[$patternPartial];
684687
$patternLineageExists = (count($patternLineages) > 0) ? true : false;
@@ -687,8 +690,9 @@ protected function gatherPartialsByMatch($patternType, $patternSubType) {
687690

688691
$p["partials"][] = array("patternName" => ucwords($patternName),
689692
"patternLink" => $patternLink,
690-
"patternPartialPath" => str_replace(" ","-",$patternTypeClean)."-".str_replace(" ","-",$patternName),
691-
"patternPartial" => $patternCode,
693+
"patternPartialPath" => str_replace(" ","-",$patternTypeClean)."-".str_replace(" ","-",$patternName),
694+
"patternCode" => $patternCode,
695+
"patternPartial" => $patternCodeHTML,
692696
"patternCSS" => $patternCSS,
693697
"patternLineageExists" => $patternLineageExists,
694698
"patternLineages" => $patternLineages,

builder/lib/generator.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Generator Class - v0.6.2
4+
* Pattern Lab Generator Class - v0.6.3
55
*
66
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

builder/lib/watcher.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Watcher Class - v0.6.2
4+
* Pattern Lab Watcher Class - v0.6.3
55
*
66
* Copyright (c) 2013 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

public/styleguide/js/code-viewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var codeViewer = {
106106
}
107107

108108
// draw html
109-
$("#sg-code-html-fill").text(html);
109+
$("#sg-code-html-fill").html(html).text();
110110
Prism.highlightElement(document.getElementById("sg-code-html-fill"));
111111

112112
// draw CSS

source/_patternlab-files/styleguide.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<h3 class="sg-code-head">HTML</h3>
3232
<pre class="sg-code-html">
3333
<code>
34-
{{ patternPartial }}
34+
{{{ patternCode }}}
3535
</code>
3636
</pre>
3737
{{# patternCSSExists }}

source/_patternlab-files/viewall.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<h3 class="sg-code-head">HTML</h3>
3232
<pre class="sg-code-html">
3333
<code>
34-
{{ patternPartial }}
34+
{{{ patternCode }}}
3535
</code>
3636
</pre>
3737
{{# patternCSSExists }}

0 commit comments

Comments
 (0)