Skip to content
Permalink
Browse files

Remove buggy HTML escaper, fix #7 incorrect documentation order

  • Loading branch information...
thesephist committed Aug 12, 2019
1 parent b3bad40 commit cf01279c5152495d92c6fe3d6a91526e780a11ce
Showing with 134 additions and 113 deletions.
  1. +1 −5 doc/generate.js
  2. +2 −2 docs/api-documentation.html
  3. +1 −1 docs/graphing-calculator-demo.html
  4. +3 −3 docs/markdown-parser-demo.html
  5. +2 −2 package.json
  6. +4 −4 samples/api.js
  7. +121 −96 yarn.lock
@@ -29,11 +29,7 @@ const FILES_TO_ANNOTATE = {
'Search UI demo': './samples/searchbar/main.js',
}

const encodeHTML = code => {
return code.replace(/[\u00A0-\u9999<>&]/gim, i => {
return '&#' + i.codePointAt(0) + ';';
});
}
const encodeHTML = code => code.replace(/[<>&]/gim, i => '&#' + i.codePointAt(0) + ';');

const linesToRows = lines => {
const linePairs = [];
@@ -573,7 +573,7 @@ <h1>API Documentation <span class="fade">annotated source</span></h1>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">670</strong>cake2.get('price_usd');</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">671</strong>// 12.99</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">672</strong></pre></div>
<div class="line"><div class="doc"><p><code>Record#summarize()</code> returns a &quot;summary&quot; of the state of the record, which is a dictionary of all of its properties, plus its id, even if it&#39;s null.</p>
<div class="line"><div class="doc"><p><code>Record#serialize()</code> will return a JSON-serialized version of the state of the record. Normally, this is the same as the summary, but we can override this behavior as appropriate.</p>
</div><pre class="source javascript"><strong class="lineNumber">675</strong>cake1.serialize();</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">676</strong>/*</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">677</strong> {</pre></div>
@@ -585,7 +585,7 @@ <h1>API Documentation <span class="fade">annotated source</span></h1>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">683</strong> }</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">684</strong>*/</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">685</strong></pre></div>
<div class="line"><div class="doc"><p><code>Record#serialize()</code> will return a JSON-serialized version of the state of the record. Normally, this is the same as the summary, but we can override this behavior as appropriate.</p>
<div class="line"><div class="doc"><p><code>Record#summarize()</code> returns a &quot;summary&quot; of the state of the record, which is a dictionary of all of its properties, plus its id, even if it&#39;s null.</p>
</div><pre class="source javascript"><strong class="lineNumber">688</strong>cake2.summarize();</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">689</strong>/*</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">690</strong> {</pre></div>
@@ -373,7 +373,7 @@ <h1>Graphing Calculator demo <span class="fade">annotated source</span></h1>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">391</strong> &#60;/div&#62;</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">392</strong> &#60;div class="inputGroup controlGroup"&#62;</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">393</strong> &#60;div class="panGroup"&#62;</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">394</strong> &#60;button class="moveUpButton" onclick="${this.moveUp}"&#62;&#9757;&#60;/button&#62;</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">394</strong> &#60;button class="moveUpButton" onclick="${this.moveUp}"&#62;&#60;/button&#62;</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">395</strong> &#60;button class="moveDownButton" onclick="${this.moveDown}"&#62;👇&#60;/button&#62;</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">396</strong> &#60;button class="moveLeftButton" onclick="${this.moveLeft}"&#62;👈&#60;/button&#62;</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">397</strong> &#60;button class="moveRightButton" onclick="${this.moveRight}"&#62;👉&#60;/button&#62;</pre></div>
@@ -47,11 +47,11 @@ <h1>Markdown Parser demo <span class="fade">annotated source</span></h1>
<div class="line"><div class="doc"><p>Some text expansions / replacements I find convenient.</p>
</div><pre class="source javascript"><strong class="lineNumber">37</strong>const BODY_TEXT_TRANSFORMS = new Map([</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">38</strong> // RegExp: replacement</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">39</strong> [/--/g, '&#8212;'], // em-dash from two dashes</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">40</strong> [/(\?!|!\?)/g, '&#8253;'], // interrobang!</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">39</strong> [/--/g, ''], // em-dash from two dashes</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">40</strong> [/(\?!|!\?)/g, ''], // interrobang!</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">41</strong> [/\$\$/g, '💵'],</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">42</strong> [/:\)/g, '🙂'],</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">43</strong> [/&#60;3/g, '&#10084;️'],</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">43</strong> [/&#60;3/g, '️'],</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">44</strong> [/:wave:/g, '👋'],</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">45</strong>]);</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">46</strong></pre></div>
@@ -37,15 +37,15 @@
"eslint": "^6.1.0",
"karma": "^4.2.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.0.0",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^1.1.2",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"marked": "^0.7.0",
"mkdirp": "^0.5.1",
"mocha": "^6.2.0",
"nyc": "^14.1.1",
"webpack": "^4.38.0"
"webpack": "^4.39.2"
},
"keywords": [
"ui",
@@ -670,8 +670,8 @@ cake2.update({
cake2.get('price_usd');
// 12.99

//> `Record#summarize()` returns a "summary" of the state of the record,
// which is a dictionary of all of its properties, plus its id, even if it's null.
//> `Record#serialize()` will return a JSON-serialized version of the state of the record.
// Normally, this is the same as the summary, but we can override this behavior as appropriate.
cake1.serialize();
/*
{
@@ -683,8 +683,8 @@ cake1.serialize();
}
*/

//> `Record#serialize()` will return a JSON-serialized version of the state of the record.
// Normally, this is the same as the summary, but we can override this behavior as appropriate.
//> `Record#summarize()` returns a "summary" of the state of the record,
// which is a dictionary of all of its properties, plus its id, even if it's null.
cake2.summarize();
/*
{

0 comments on commit cf01279

Please sign in to comment.
You can’t perform that action at this time.