Skip to content
Permalink
Browse files

Stop using deprecated sanitize option in marked (markdown renderer), …

…fix typo from 2874592
  • Loading branch information...
thesephist committed Jul 18, 2019
1 parent 2874592 commit e2f811274266d1015cd57c975ffbbfd7becc3cfd
Showing with 3 additions and 9 deletions.
  1. +1 −6 doc/generate.js
  2. +1 −2 docs/hacker-news-reader.html
  3. +1 −1 samples/api.js
@@ -35,11 +35,6 @@ const encodeHTML = code => {
});
}

const markedOptions = {
sanitize: true,
sanitizer: encodeHTML,
}

const linesToRows = lines => {
const linePairs = [];
let docLine = '';
@@ -51,7 +46,7 @@ const linesToRows = lines => {
if (lastLine && lastLine[0]) {
linePairs.push(['', '', '']);
}
linePairs.push([marked(docLine, markedOptions), encodeHTML(codeLine), lineNumber]);
linePairs.push([marked(docLine), encodeHTML(codeLine), lineNumber]);
} else {
linePairs.push(['', encodeHTML(codeLine), lineNumber]);
}
@@ -526,8 +526,7 @@ <h1>Hacker News Reader <span class="fade">annotated source</span></h1>
<div class="line"><div class="doc"><p>List of comments, both at the top level and nested under other comments</p>
</div><pre class="source javascript"><strong class="lineNumber">535</strong>class CommentList extends Styled(ListOf(CommentListing)) {</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">536</strong></pre></div>
<div class="line"><div class="doc"><p>&#60;ul&#62; elements automatically come with a default left padding we don&#39;t want.</p>
</div><pre class="source javascript"><strong class="lineNumber">538</strong> styles() {</pre></div>
<div class="line"><div class="doc"><ul> elements automatically come with a default left padding we don't want.</div><pre class="source javascript"><strong class="lineNumber">538</strong> styles() {</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">539</strong> return css`padding-left: 0`;</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">540</strong> }</pre></div>
<div class="line"><div class="doc"></div><pre class="source javascript"><strong class="lineNumber">541</strong></pre></div>
@@ -526,7 +526,7 @@ const StyledComponent = Styled(Component); // literally what's in Torus's source
//> Here's a sample of the ways you can define styles this way.
class FancyList extends StyledComponent {

//> We define all of our styles in a `styled()` method, which returns a JSON
//> We define all of our styles in a `styles()` method, which returns a JSON
// that resembles normal CSS, but with nesting and automagical media query resolution,
// as well as downward scoping of CSS rules to this component. That means that when we
// style `button` in this component, it won't ever conflict with other `button` elements

0 comments on commit e2f8112

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