Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
v0.2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-martin committed Apr 4, 2014
1 parent 43d6829 commit ca3cd43
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/History.html
Expand Up @@ -280,6 +280,10 @@



<h1>0.2.11</h1>
<ul>
<li>Added <code>comb.string.escapeHtml</code></li>
</ul>
<h1>0.2.10</h1>
<ul>
<li>Added check to log functions for level before formatting message or delegating to <code>log</code>.</li>
Expand Down Expand Up @@ -446,7 +450,7 @@ <h1>0.1.3/2012-08-16</h1>
<li>Changed appenders to register themselves for dynamic appender creation</li>
</ul>
</li>
<li>Updated docs </li>
<li>Updated docs</li>
</ul>
<h1>0.1.2/2012-07-17</h1>
<ul>
Expand All @@ -455,7 +459,7 @@ <h1>0.1.2/2012-07-17</h1>
</ul>
</li>
<li>Added comb.array.multiply</li>
<li>Updated docs to use <a href="https://github.comb/doug-martin/coddoc">coddoc</a> </li>
<li>Updated docs to use <a href="https://github.comb/doug-martin/coddoc">coddoc</a></li>
</ul>
<h1>0.1.1/2012-04-20</h1>
<ul>
Expand Down Expand Up @@ -505,7 +509,7 @@ <h1>0.0.9 /2012-02-16</h1>
</ul>
<h1>0.0.8 / 2012-02-9</h1>
<ul>
<li>Added new MethodMissing plugin </li>
<li>Added new MethodMissing plugin</li>
<li>Bug fixes<ul>
<li>Changed inflections to underscore between word boundaries and numbers and vice versa with camelize.</li>
</ul>
Expand Down
87 changes: 87 additions & 0 deletions docs/comb_string.html
Expand Up @@ -306,6 +306,21 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Methods<b class="caret"></b></a>
<ul class="dropdown-menu">

<li><a href="./comb_string.html#.escapeHtml">

<span class="label label-info">S</span>


<span class="label label-label">F</span>



<span class="label label-success">P</span>


escapeHtml
</a></li>

<li><a href="./comb_string.html#.format">

<span class="label label-info">S</span>
Expand Down Expand Up @@ -713,13 +728,85 @@
}
}
return ret;
},
/**
* Escapes an HTML string by replacing &amp;lt;&gt;&amp;&quot; characters.
*
* @example
* comb.string.escapeHtml(&#x27;&amp;lt;script&gt;alert(&quot;test&quot;)&amp;lt;/script&gt;&#x27;); // &amp;lt;script&amp;gt;alert(&quot;test&quot;)&amp;lt;/script&amp;gt;
*
* @param {String} str The string to escape.
*/
escapeHtml: function(str) {
return String(str)
.replace(/&amp;/g, &#x27;&amp;amp;&#x27;)
.replace(/&amp;lt;/g, &#x27;&amp;lt;&#x27;)
.replace(/&gt;/g, &#x27;&amp;gt;&#x27;)
.replace(/&quot;/g, &#x27;&amp;quot;&#x27;)
.replace(/&#x27;/g, &#x27;&amp;#39;&#x27;);
}
};
</pre>




<a name=".escapeHtml"></a>
<h3>
escapeHtml

<span class="label label-info">Static</span>


<span class="label label-label">Function</span>



<span class="label label-success">Public</span>


</h3>

<hr/>
<em>Defined base/string.js</em>

<p><p>Escapes an HTML string by replacing &lt;&gt;&amp;&quot; characters.</p>
</p>

<em>Example</em>
<pre class="prettyprint linenums lang-js">
comb.string.escapeHtml(&#x27;&lt;script&gt;alert(&quot;test&quot;)&lt;/script&gt;&#x27;); // &amp;lt;script&amp;gt;alert(&quot;test&quot;)&amp;lt;/script&amp;gt;
</pre>


<em>Arguments</em>
<ul>

<li> <em>str</em> : <p>The string to escape.</p>
</li>

</ul>





<em>Source</em>
<pre class="prettyprint linenums lang-js">
function (str){
return String(str)
.replace(/&amp;/g, &#x27;&amp;amp;&#x27;)
.replace(/&amp;lt;/g, &#x27;&amp;lt;&#x27;)
.replace(/&gt;/g, &#x27;&amp;gt;&#x27;)
.replace(/&quot;/g, &#x27;&amp;quot;&#x27;)
.replace(/&#x27;/g, &#x27;&amp;#39;&#x27;);

}
</pre>




<a name=".format"></a>
<h3>
format
Expand Down

0 comments on commit ca3cd43

Please sign in to comment.