You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some version of the below could be adapted to suit our needs.
// Forgoing jQuery, using https://gist.github.com/jameswomack/d3b536298687e3264810vararticles=$('[itemprop=articleBody]');articles.forEach(functionpullQuotesInArticle(article){// Linguistic analysis could be used to forgo placeholders// but this solution is more flexible in terms of designvarplaceholderEls=article.$('section[for=pullquote]');varplaceHolderCount=placeholderEls.length;// Only pull as many quotes as there are placeholdersvarquoteEls=article.$('[data-pullquote]').slice(0,placeHolderCount);quoteEls.forEach(function(quoteEl,index){placeholderEls[index].appendChild(quoteEl);});});
<divitemprop="articleBody" class="article-body"><sectionfor="pullquote"></section><!-- a pullquote placeholder --><p><spandata-pullquote>Polyglot Weekly grows from the question, <em>"what would get me blogging more often?"</em></span>I came up with a list of answers:</p> ...
<p>I can't wait to see what comes of this,</p><p>— Ben.</p></div>
Based on @jameswomack's suggestion, it would be slick if we could programmatically specify pull quotes.
The text was updated successfully, but these errors were encountered: