men

A companion to the New Testament. Paul and the Pauline letters / Matthew L. Skinner

Skinner, Matthew L., 1968- author




men

The meaning of Jesus' death : reviewing the New Testament's interpretations / Barry D. Smith

Smith, Barry D., 1957 December 4- author




men

The Bible and disability : a commentary / Sarah J. Melcher, Mikeal C. Parsons, Amos Yong, editors




men

A concise guide to reading the New Testament : a canonical introduction / David R. Nienhuis

Nienhuis, David R., 1968- author




men

Jude on the attack : a comparative analysis of the epistle of Jude, Jewish judgement oracles, and Greco-Roman invective / Alexandra Robinson

Robinson, Alexandra, author




men

Rereading Romans from the perspective of Paul's gospel : a literary and theological commentary / Yung Suk Kim

Kim, Yung Suk, author




men

The vehement Jesus : grappling with troubling Gospel texts / David J. Neville

Neville, David J., author




men

The Bible and social justice : Old Testament and New Testament foundations for the church's urgent call / edited by Cynthia Long Westfall and Bryan R. Dyer




men

Neither complementarian nor egalitarian : a kingdom corrective to the evangelical gender debate / Michelle Lee-Barnewall ; foreword by Craig L. Blomberg ; afterword by Lynn H. Cohick

Lee-Barnewall, Michelle, 1966- author




men

The way of the Lord : christological exegesis of the Old Testament in the Gospel of Mark / Joel Marcus

Marcus, Joel, 1951- author




men

Admen and Eve : the Bible in contemporary advertising / Katie B. Edwards

Edwards, Katie B., author




men

The bad Jesus : the ethics of New Testament ethics / Hector Avalos

Avalos, Hector, author




men

The New Testament : a historical introduction to the early Christian writings / Bart D. Ehrman

Ehrman, Bart D., author




men

The queer Bible commentary / edited by Deryn Guest, Robert E. Goss, Mona West and Thomas Bohache




men

The resurrection of Mary Magdalene : legends, apocrypha, and the Christian testament / Jane Schaberg

Schaberg, Jane, author




men

Understanding the social world of the New Testament / edited by Dietmar Neufeld and Richard E. DeMaris




men

New Testament Christianity in the Roman world / Harry O. Maier

Maier, Harry O., 1959- author




men

Women in the New Testament world / Susan E. Hylen

Hylen, Susan, author




men

The enchantments of Mammon : how capitalism became the religion of modernity / Eugene McCarraher

McCarraher, Eugene, author




men

Costly communion : ecumenical initiative and sacramental strife in the Anglican Communion / edited by Mark D. Chapman, Jeremy Bonner




men

Fundamentalism or tradition : Christianity after secularism / Aristotle Papanikolaou and George E. Demacopoulo, editors




men

The garb of being : embodiment and the pursuit of holiness in late ancient Christianity / Georgia Frank, Susan R Holman, and Andrew S. Jacobs, editors




men

Interpreting the New Testament : an introduction / Sherri Brown & Francis J. Moloney, SDB

Brown, Sherri, author




men

Myths and mistakes in New Testament textual criticism / edited by Elijah Hixson and Peter J. Gurry ; foreword by Daniel B. Wallace




men

The New Testament in its world : an introduction to the history, literature, and theology of the first Christians / N.T. Wright, Michael F. Bird

Wright, N. T. (Nicholas Thomas), author




men

A pentecostal hermeneutic : spirit, scripture, and community / Kenneth J. Archer

Archer, Kenneth J., author




men

Handbook of global contemporary Christianity : movements, institutions, and allegiance / edited by Stephen Hunt




men

Worship and social engagement in urban Aboriginal-led Australian Pentecostal congregations : (re)imagining identity in the spirit / by Tanya Riches

Riches, Tanya, author




men

1 Corinthians : a pastoral commentary / J. Ayodeji Adewuya ; foreword by Daniel K. Darko

Adewuya, J. Ayodeji, 1951- author




men

2 Corinthians : a short exegetical and pastoral commentary / Anthony C. Thiselton

Thiselton, Anthony C., author




men

Essential essays for the study of the military in first-century Palestine : soldiers and the New Testament context / edited by Christopher B. Zeichman




men

Paul decentered : reading 2 Corinthians with the Corinthian women / Arminta M. Fox

Fox, Arminta M., author




men

The failure of evangelical mental health care : treatments that harm women, LGBT persons and the mentally ill / John Weaver

Weaver, John, 1980- author




men

Sacraments, ceremonies and the Stuart divines : sacramental theology and liturgy in England and Scotland 1603-1662 / Bryan D. Spinks

Spinks, Bryan D., author




men

Enlightenment Reformation : Hutchinsonianism and religion in eighteenth-century Britain / Derya Gurses Tarbuck

Gurses Tarbuck, Derya, author




men

Richard Hooker, beyond certainty / Andrea Russell (the Queen's Foundation for Ecumenical Theological Education, Birmingham, UK)

Russell, Andrea, author




men

Biomarkers in Drug Discovery and Development: A Handbook of Practice, Application, and Strategy, 2nd Edition


 
This book continues the legacy of a well-established reference within the pharmaceutical industry – providing perspective, covering recent developments in technologies that have enabled the expanded use of biomarkers, and discussing biomarker characterization and validation and applications throughout drug discovery and development.

•    Explains where proper use of biomarkers can substantively impact drug development timelines and costs, enable selection

Read More...




men

A three-dimensional electrode bioelectrochemical system for the advanced oxidation of p-nitrophenol in an aqueous solution

RSC Adv., 2020, 10,17163-17170
DOI: 10.1039/C9RA08538F, Paper
Open Access
Jing Ren, Haoxin Li, Na Li, Youtao Song, Jiayi Chen, Lin Zhao
PNP absorbed in and surrounded by GPEs has kinetic favorability in the degradation process by a three-dimensional electrode MFC-Fenton system.
The content of this RSS Feed (c) The Royal Society of Chemistry




men

La2O2CO3:Tb3+ one-dimensional nanorod with green persistent luminescence

RSC Adv., 2020, 10,17180-17184
DOI: 10.1039/D0RA01926G, Paper
Open Access
Xiaojing Dou, Yang Li, Ru Kang, Huiwang Lian, Zhenzhang Li
Trivalent terbium-doped oxycarbonate (La2O2CO3:1%Tb3+) one-dimensional nanorods are synthesized via a facile precipitation method.
The content of this RSS Feed (c) The Royal Society of Chemistry




men

Impact of ammonium sulfite-based sequential pretreatment combinations on two distinct saccharifications of wheat straw

RSC Adv., 2020, 10,17129-17142
DOI: 10.1039/D0RA01759K, Paper
Open Access
Guang Yu, Shiyue Liu, Xiaoyan Feng, Yuedong Zhang, Chao Liu, Ya-Jun Liu, Bin Li, Qiu Cui, Hui Peng
The impact of substrate properties on wheat straw sugar release from fungal cellulase and whole cell-based CBS was comparatively investigated.
The content of this RSS Feed (c) The Royal Society of Chemistry




men

Two-dimensional β-MoO3@C nanosheets as high-performance negative materials for supercapacitors with excellent cycling stability

RSC Adv., 2020, 10,17497-17505
DOI: 10.1039/D0RA01258K, Paper
Open Access
Xuexia Liu, Ying Wu, Huiwen Wang, Yinfeng Wang, Chunfang Huang, Limin Liu, Zhijun Wang
MoO3 has gained a great deal of attention as a promising electrode material in energy storage devices.
The content of this RSS Feed (c) The Royal Society of Chemistry




men

Detection of L-band electron paramagnetic resonance in the DPPH molecule using impedance measurements

RSC Adv., 2020, 10,17311-17316
DOI: 10.1039/D0RA03285A, Paper
Open Access
Ushnish Chaudhuri, R. Mahendiran
(a) Schematic diagram of our experimental set up. (b) Resistance and reactance of the DPPH molecule for 2 GHz current in the strip coil.
The content of this RSS Feed (c) The Royal Society of Chemistry




men

Effects of ozone treatment on SOD activity and genes in postharvest cantaloupe

RSC Adv., 2020, 10,17452-17460
DOI: 10.1039/D0RA00976H, Paper
Open Access
Huijie Zhang, Xiaojun Zhang, Chenghu Dong, Na Zhang, Zhaojun Ban, Li Li, Jinze Yu, Yunfeng Hu, Cunkun Chen
Ozone has been shown to play a positive role in the storage and preservation of agricultural products.
The content of this RSS Feed (c) The Royal Society of Chemistry




men

Synthesis and gas permeation properties of thermally rearranged poly(ether-benzoxazole)s with low rearrangement temperatures

RSC Adv., 2020, 10,17461-17472
DOI: 10.1039/D0RA00145G, Paper
Open Access
Yunhua Lu, Jianhua Zhang, Guoyong Xiao, Lin Li, Mengjie Hou, Junyi Hu, Tonghua Wang
A series of poly(ether-benzoxazole)(PEBO) for gas separation were prepared from 9,9-bis[4-(4-amino-3-hydroxylphenoxy)phenyl]fluorene based hydroxyl-containing poly(ether-imide)s (HPEIs) with low rearrangement temperatures.
The content of this RSS Feed (c) The Royal Society of Chemistry




men

Development of novel N-(6-methanesulfonyl-benzothiazol-2-yl)-3-(4-substituted-piperazin-1-yl)-propionamides with cholinesterase inhibition, anti-β-amyloid aggregation, neuroprotection and cognition enhancing properties for the therapy of Alzheimer's d

RSC Adv., 2020, 10,17602-17619
DOI: 10.1039/D0RA00663G, Paper
Open Access
Chandra Bhushan Mishra, Shruti Shalini, Siddharth Gusain, Amresh Prakash, Jyoti Kumari, Shikha Kumari, Anita Kumari Yadav, Andrew M. Lynn, Manisha Tiwari
A novel series of benzothiazole–piperazine hybrids were rationally designed, synthesized, and evaluated as multifunctional ligands against Alzheimer's disease (AD).
The content of this RSS Feed (c) The Royal Society of Chemistry




men

Correction: Influence of co-cultures of Streptococcus thermophilus and probiotic lactobacilli on quality and antioxidant capacity parameters of lactose-free fermented dairy beverages containing Syzygium cumini (L.) Skeels pulp

RSC Adv., 2020, 10,16905-16905
DOI: 10.1039/D0RA90046J, Correction
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Sabrina Laís Alves Garcia, Gabriel Monteiro da Silva, Juliana Maria Svendsen Medeiros, Anna Paula Rocha de Queiroga, Blenda Brito de Queiroz, Daniely Rayane Bezerra de Farias, Joyceana Oliveira Correia, Eliane Rolim Florentino, Flávia Carolina Alonso Buriti
The content of this RSS Feed (c) The Royal Society of Chemistry




men

Thoughts on some new HTML5 elements

In the last few months there has been increased discussion about some of the new elements that have been introduced in the HTML5 draft specification. This entry is primarily a counter argument to some of the comments that I disagree with.

The most recent and high-profile comments in regard to parts of the HTML5 specification come from The HTML5 Super Friends in an article entitled Guide to HTML5 Hiccups. It lays out their concerns with the HTML5 draft specification as it stood at the time of its writing and I am largely going to focus on the issues they have discussed.

The article and section elements

The first argument that I disagree with is that the article and section elements are redundant and, therefore, that the article element should be dropped.

article and section are identical except that article allows a pubdate attribute. We would suggest that article be dropped and section be adapted to allow an optional pubdate attribute or, even better, more explicit metadata.

The article and section elements are not identical according the to HTML5 draft specification. Here is what it says about the section element as of 13 September 2009:

The section element represents a generic document or application section. A section, in this context, is a thematic grouping of content, typically with a heading, possibly with a footer.

Now contrast that with what it says about the the article element:

The article element represents a section of a page that consists of a composition that forms an independent part of a document, page, application, or site.

An article element is “independent” in the sense that its contents could stand alone, for example in syndication, or as a interchangeable component on a user-configurable portal page.

That is a clear distinction that resists the reading of article and section being “identical”. The article element has a specific purpose: to mark parts of a document that form an independent composition that may be appropriate for syndication. It is a special kind of sectioning element that performs an essential role that is lacking in the semantics of the generic section element. This generic element serves only to thematically group content. That grouping may occur at the document level, within an independent article, or within a footer.

The article element has unique semantics and practical use. There is a fundamental conceptual difference between stand-alone compositions and sections of compositions, documents, or pages and this difference should be recognised and catered for in the specification. Websites regularly employ microformats and you don’t have to look far to see independent compositions currently marked up with class="hentry" or find links to individual blog comments and twitter updates. There is clearly a need for an easy way to define independent compositions and that is met with the introduction of the article element in HTML5.

What may be needed is a stronger clarification and definition of the article element to minimise the potential for this distinction to be overlooked and to highlight the differences from a generic document section.

The hgroup element

The hgroup element is a relatively recent addition to the draft specification. It is defined as serving a fairly specific purpose:

The hgroup element represents the heading of a section. The element is used to group a set of h1h6 elements when the heading has multiple levels, such as subheadings, alternative titles, or taglines.

The element works to associate headings together so that the highest ranked heading descendant (if present) of the hgroup element is used as its text in document outlines and summary. Other heading descendants are treated as subheadings and are left out of outlines.

The HTML5 Super Friends have this to say about the hgroup element:

We don’t see the added value of this element and would instead add a boolean attribute to the heading element which allows content authors to specify if that particular heading should be included in the outline.

Bruce Lawson has similar concerns and proposes another alternative – removing the need for a wrapping element and defining a new element specifically for marking up subtitles:

I agree that hgroup is clumsy and likely to be misused. Rather than wrap an h1 and its h2 subtitle in hgroup to keep the subtitle out of the outlining algorithm, I would prefer to use

<header>
<h1>My blog</h1>
<subtitle>My wit and wisdom</subtitle>
</header>

as I think that;s easier to understand than a heading-that’s-not-a-heading, and it removes a wrapping element.

I disagree with these criticisms of the hgroup element and consider the proposed alternatives to be more problematic, less intuitive, less flexible, and further removed from the way in which authors currently markup subheadings.

The way that many authors are currently marking up subheadings is by using headings of various ranks and in various orders depending on whether the subheading or qualifying heading needs to appear above or below the main page heading. A subheading is still, conceptually, a heading of sorts and it cannot be accurately marked up with a paragraph or any other currently available element.

Allowing the addition of a boolean attribute to heading elements has several problems.

  1. A boolean attribute may be less intuitive for authors than the hgroup element. The hgroup element relies upon and produces an association between all the headings it contains. Since headings and subheadings occur together and derive their meaning from each other, it is semantic to wrap these headings in an element. We know that the highest ranked heading contains the string to be used in the outline and that the other headings serve as ranked subheadings to this primary heading. A boolean attribute is only associated with the element that it is a part of. We can create no association between the element and adjacent elements. This is related to the next issue.

  2. The hgroup itself acts as heading content while a boolean attribute would act only to remove headings from the outline. The hgroup element only removes the descendant headings that are those not of the highest rank. The boolean attribute shifts the burden onto the author to decide which headings should be marked for removal from the outline, rather than providing an element to wrap a collection of headings without authors having to be concerned with (or aware of) issues of outlining.

What about Bruce Lawson’s idea for a subtitle element? I believe that, irrespective of the what this element were actually called, it suffers from similar problems to the idea of using a boolean attribute. There is nothing to prevent the use of a subtitle element away from a heading, it creates no association with other elements, and it does not allow for ranking of subheadings.

One of my key points in relation to criticism of the hgroup element is that subheadings draw their meaning from context. A subheading (as opposed to a section heading) is only a sub-heading if it is associated with a higher ranking heading. Remove the higher ranking heading and what was once a subheading is likely to be understood as a heading.

The strength of the hgroup element over the two alternative suggestions I have referenced is that it is the only proposal that defines a subheading as contextual. I think that it is the most intuitive proposal (although perhaps none of them are particularly inuitive) – the name of the element is self-descriptive and encapsulates the contextual relationship and adjacent positioning of its child elements — and matches most closely with the way that subheadings are currently marked up on many websites.

The aside element

The HTML5 Super Friends are of the opinion that the aside element is not worth including in the specification:

The use cases for aside are too limited to warrant its inclusion in the specification. We were also concerned about potentially duplicating content within an aside.

However, the specification itself provides some fairly compelling uses for the element:

The element can be used for typographical effects like pull quotes or sidebars, for advertising, for groups of nav elements, and for other content that is considered separate from the main content of the page.

Authors might use the aside element for their blogrolls, for marking up adverts ranging from google ads on blogs to large banners on enterprise websites, for expanding on themes within an article or providing an extended definition of a term, for pull quotes, and anything else “tangentially related to the content around the aside element, and which could be considered separate from that content”.

Most of these uses would not involve duplication of content. Using the aside element for pull quotes would produce some instances of content duplication. However, this is not really a problem for users who are used to content being duplicated in this way in newspapers and magazines. It would not take much for search engines to adapt to deal with short amounts of duplicate content contained within an aside either. While I appreciate the point about duplicate content I’m not yet convinced that it is actually problematic.

The legend element

The current specification defines the legend element as providing an explanatory caption for the contents of its parent element. The parent element may be a fieldset, figure or details element. However, Remy Sharp‘s article entitled legend not such a legend anymore shows why it is not practical to use legend for the new elements details and figure – because it is not backwards compatible with current browsers and effectively unusable outside of a fieldset because of the inability to style the element.

In this case, forging a new element is most appropriate rather than trying to use an element like label which will only create confusion with little advantage.

Summary

I have discussed my reasons for disagreeing with certain feedback on the HTML5 draft specification. I have yet to be convinced that the article, hgroup, or aside elements should be dropped from the specification because it seems to me that they have necessary uses and advantages over alternatives.




men

New HTML5 elements: summary & figcaption

Over the weekend two new HTML5 elements – summary and figcaption – were added to the draft specification. The introduction of summary and figcaption marks the acceptance that new elements are needed to act as captions or legends for the details and figure elements. The addition of the figcaption element finally begins to clear up the difficulty in marking-up figure element captions and looks to cement the place of the figure element in the HTML5 specification. The summary element does much the same for the details element but the very nature of the details element itself means that its future is not yet clear.

The figcaption element

This new element acts as the optional caption or legend for any content contained within its parent figure element.

If there is no figcaption element within a figure element then there is no caption for the rest of its content. If there is a figcaption element then it must be the first or last child of the figure element and only the first figcaption element (should there be more than one child figcaption of the parent figure element) represents a caption.

The figure element is used to mark up any self-contained content that may be referenced from the main flow of a document but could also be removed from the primary content (for example, to an appendix) without affecting its flow. This makes it suitable for various types of content ranging from graphs and data tables to photographs and code blocks.

<p><a href="#fig-ftse">Figure 1</a> shows the extent of the collapse in the markets and how recovery has been slow.</p>

<figure id="fig-ftse">
  <figcaption>Figure 1. The value of the FTSE 100 Index from 1999&ndash;2009.</figcaption>
  <img src="ftse-100-index-graph.jpg" alt="The index hit a record high at the end of 1999 and experienced two significant drops in the following last decade.">
</figure>

<p>This latest financial crisis hasn't stopped Alex from writing music and his latest track is actually worth listening to.</p>

<figure>
  <audio src="what-am-i-doing.mp3" controls></audio>
  <figcaption><cite>What am I doing?</cite> by Alex Brown</figcaption>
</figure>

The creation of the figcaption element is an important step forward for the HTML5 draft specification as it finally provides a reliable means to markup the caption for content that is best marked up as a figure. Previous attempts to use the legend element, the caption element, and the dt and dd elements had failed due to a lack of backwards compatibility when it came to styling these elements with CSS.

The summary element

This new element represents a summary, caption, or legend for any content contained within its parent details element.

The summary element must be the first child of a details element and if there is no summary element present then the user agent should provide its own. The reason for this is because the details element has a specific function – to markup additional information and allow the user to toggle the visibility of the additional information. Although it is not specified in the specification, it is expected that the summary element will act as the control that toggles the open-closed status of the contents of the parent details element.

<details>
  <summary>Technical details.</summary>
  <dl>
    <dt>Bit rate:</dt> <dd>190KB/s</dd>
    <dt>Filename:</dt> <dd>drum-and-bass-mix.mp3</dd>
    <dt>Duration:</dt> <dd>01:02:34</dd>
    <dt>File size:</dt> <dd>78.9MB</dd>
  </dl>
</details>

The introduction of the summary element seems to secure the future of the details element and the new behaviour that it affords, for now. When user agents begin to add support for the details element you won’t need JavaScript, or even CSS, to have expanding or collapsing sections in an HTML document.

The future of the details element

There will continue to be some debate over the inclusion of behaviour in an HTML specification especially given the widespread use of JavaScript to provide the expand-collapse functionality that details describes.

The details element writes some quite significant behaviour into an HTML document and I can see it being abused to provide generic expand-collapse functionality throughout a document. It is also not entirely clear what purpose the details element actually serves other than being an attempt to bypass the need for JavaScript or CSS to expand or collapse sections of a document.

There has been a general softening of the rough distinction between content, presentation, and behaviour. JavaScript libraries are being used to patch holes in browser CSS and HTML5 support, the CSS3 modules introduce plenty of behaviour that was previously only possibly with JavaScript, and the HTML5 specification is also introducing functionality and behaviour that previously required the use of JavaScript.

The future survival of the details element, and the behaviour associated with it, may well depend on browser implementations and author applications over the coming months.




men

CSS typography experiment

This is a quick experiment that reproduces an image from I Love Typography using semantic HTML, CSS 2.1, a little CSS3. Along the way, I learnt about a few modern browser bugs and inconsistencies.

I came across an image on I Love Typography that I thought could be reproduced using only semantic HTML and CSS.

A scaled down and cropped version of the I Love Typography A Lot image from I Love Typography.

The idea was to reproduce the image from simple markup, and to rely as much as possible on what can be achieved with CSS.

This is the HTML I ended up using.

<p>I love <strong>typography</strong> <em>a lot</em></p>

This is the CSS that controls the presentation of that content.

body {
  padding: 0;
  margin: 0;
  font-family: Times New Roman, serif;
  background: #000;
}

p {
  position: relative;
  width: 1100px;
  padding: 100px 0 0;
  margin: 0 auto;
  font-size: 175px;
  font-weight: bold;
  line-height: 1.2;
  letter-spacing: -13px;
  color: #0caac7;
  transform: rotate(-20deg);
}

/* "i" */
p:first-letter {
  float: left;
  margin: -137px -20px 0 0;
  font-size: 880px;
  line-height: 595px;
  text-transform: lowercase;
}

/* "love" */
p:first-line {
  font-size: 200px;
}

/* "typography" */
p strong {
  display: block;
  margin: -80px 0 0;
  font-weight: normal;
  letter-spacing: -2px;
  text-transform: capitalize;
}

p strong:first-letter {
  margin-right: -30px;
  color: #fff;
}

/* "a lot" */
p em {
  position: absolute;
  z-index: 10;
  top: 100px;
  left: 147px;
  width: 136px;
  overflow: hidden;
  padding-left: 64px;
  font-size: 200px;
  font-style: normal;
  text-transform: lowercase;
  color: #fff;
}

p em:first-letter {
  float: left;
  margin: 130px 0 0 -55px;
  font-size: 80px;
  font-style: italic;
  line-height: 20px;
  color: #fff;
}

/* create the heart shape */
p:before,
p:after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 225px;
  left: 120px;
  width: 75px;
  height: 50px;
  background: #000;
  transform: rotate(45deg);
  border-radius: 25px 0 0 30px;
}

p:after {
  left: 138px;
  transform: rotate(-45deg);
  border-radius: 0 25px 30px 0;
}

/* hide the tip of the "t" from "a lot" */
p strong:before {
  content: "";
  position: absolute;
  z-index: 11;
  top: 205px;
  left: 341px;
  width: 7px;
  height: 7px;
  background: #000;
  border-radius: 7px;
}

The final CSS typography experiment approximates the original image in all modern browsers that support the CSS3 properties of border-radius and transform.

Some browsers render type (especially after rotational transformations) better than others. Note that all the screenshots are taken from browsers running on Windows Vista OS.

Opera 10.5. The closest approximation to the original source image.
Chrome 4.0. Identical to Opera 10.5 apart from a bug that appears in the rendering of rounded corners when they undergo a rotational transformation.
Safari 4.0. The rotated type suffers from a lack of anti-aliasing.
Firefox 3.6. The rotated type suffers from a lack of anti-aliasing.

Browser bugs and inconsistencies

I’ve put together a small test page to highlight some new CSS 2.1 and CSS3 bugs in modern browsers. It includes two new CSS 2.1 bugs in Internet Explorer 8.




men

Using HTML5 elements in WordPress post content

Here are two ways to include HTML5 elements in your WordPress post content without WordPress’ wpautop function wrapping them in p tags or littering your code with line breaks.

HTML5 has several new elements that you may want to use in your post content to markup document sections, headers, footers, pullquotes, figures, or groups of headings. One way to safely include these elements in your posts is simple; the other way is a bit more complicated. Both ways rely on hand-coding the HTML5 markup in the WordPress editor’s HTML view.

If you are adding HTML5 elements to your post content then you should use an HTML5 doctype.

Disable wpautop for your theme

This is the simple way. Disable the wpautop function so that WordPress makes no attempt to correct your markup and leaves you to hand-code every line of your posts. If you want total control over every line of your HTML then this is the option for you.

To disable wpautop entirely add these lines to your theme’s functions.php:

remove_filter('the_excerpt', 'wpautop');
remove_filter('the_content', 'wpautop');

However, wpautop is generally quite useful if most of your posts are simple text content and you only occasionally want to include HTML5 elements. Therefore, modifying wpautop to recognise HTML5 elements might be more practical.

Modify wpautop to recognise HTML5 elements

WordPress’ wpautop is part of the core functions and can be found in this file within your WordPress installation: wp-includes/formatting.php. It controls how and where paragraphs and line breaks are inserted in excerpts and post content.

In order to create a modified version of WordPress’ core wpautop function I started off by duplicating it in my theme’s functions.php file.

What I’ve experimented with is disabling wpautop and adding a modified copy of it – which includes HTML5 elements in its arrayss – to my theme’s functions.php file.

Add the following to your theme’s functions.php file and you’ll be able to use section, article, aside, header, footer, hgroup, figure, details, figcaption, and summary in your post content. (Probably best to try this in a testing environment first!)

/* -----------------------------
MODIFIED WPAUTOP - Allow HTML5 block elements in wordpress posts
----------------------------- */

function html5autop($pee, $br = 1) {
   if ( trim($pee) === '' )
      return '';
   $pee = $pee . "
"; // just to make things a little easier, pad the end
   $pee = preg_replace('|<br />s*<br />|', "

", $pee);
   // Space things out a little
    // *insertion* of section|article|aside|header|footer|hgroup|figure|details|figcaption|summary
   $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|header|footer|hgroup|figure|details|figcaption|summary)';
   $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "
$1", $pee);
   $pee = preg_replace('!(</' . $allblocks . '>)!', "$1

", $pee);
   $pee = str_replace(array("
", "
"), "
", $pee); // cross-platform newlines
   if ( strpos($pee, '<object') !== false ) {
      $pee = preg_replace('|s*<param([^>]*)>s*|', "<param$1>", $pee); // no pee inside object/embed
      $pee = preg_replace('|s*</embed>s*|', '</embed>', $pee);
   }
   $pee = preg_replace("/

+/", "

", $pee); // take care of duplicates
// make paragraphs, including one at the end
   $pees = preg_split('/
s*
/', $pee, -1, PREG_SPLIT_NO_EMPTY);
   $pee = '';
   foreach ( $pees as $tinkle )
      $pee .= '<p>' . trim($tinkle, "
") . "</p>
";
   $pee = preg_replace('|<p>s*</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace
// *insertion* of section|article|aside
   $pee = preg_replace('!<p>([^<]+)</(div|address|form|section|article|aside)>!', "<p>$1</p></$2>", $pee);
   $pee = preg_replace('!<p>s*(</?' . $allblocks . '[^>]*>)s*</p>!', "$1", $pee); // don't pee all over a tag
   $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists
   $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
   $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
   $pee = preg_replace('!<p>s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
   $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)s*</p>!', "$1", $pee);
   if ($br) {
      $pee = preg_replace_callback('/<(script|style).*?</\1>/s', create_function('$matches', 'return str_replace("
", "<WPPreserveNewline />", $matches[0]);'), $pee);
      $pee = preg_replace('|(?<!<br />)s*
|', "<br />
", $pee); // optionally make line breaks
      $pee = str_replace('<WPPreserveNewline />', "
", $pee);
   }
   $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)s*<br />!', "$1", $pee);
// *insertion* of img|figcaption|summary
   $pee = preg_replace('!<br />(s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol|img|figcaption|summary)[^>]*>)!', '$1', $pee);
   if (strpos($pee, '<pre') !== false)
      $pee = preg_replace_callback('!(<pre[^>]*>)(.*?)</pre>!is', 'clean_pre', $pee );
   $pee = preg_replace( "|
</p>$|", '</p>', $pee );

   return $pee;
}

// remove the original wpautop function
remove_filter('the_excerpt', 'wpautop');
remove_filter('the_content', 'wpautop');

// add our new html5autop function
add_filter('the_excerpt', 'html5autop');
add_filter('the_content', 'html5autop');

The results are not absolutely perfect but then neither is the original wpautop function. Certain ways of formatting the code will result in unwanted trailing </p> tags or a missing opening <p> tags.

For example, to insert a figure with caption into a post you should avoid adding the figcaption on a new line because an image or link appearing before the figcaption will end up with a trailing </p>.

<!-- this turns out ok -->
<figure>
  <a href="#"><img src="image.jpg" alt="" /></a><figcaption>A figure caption for your reading pleasure</figcaption>
</figure>

<!-- this turns out not so ok -->
<figure>
  <a href="#"><img src="image.jpg" alt="" /></a>
  <figcaption>A figure caption for your reading pleasure</figcaption>
</figure>

Another example would be when beginning the contents of an aside with a paragraph. You’ll have to leave a blank line between the opening aside tag and the first paragraph.

<aside>

This content could be a pullquote or information that is tangentially related to the surrounding content. But to get it wrapped in a paragraph you have to leave those blank lines either side of it before the tags.

</aside>

Room for improvement

Obviously there are still a few issues with this because if you format your post content in certain ways then you can end up with invalid HTML, even if it doesn’t actually affect the rendering of the page. But it seems to be pretty close!

Leave a comment or email me if you are using this function and find there that are instances where it breaks down. I ran numerous tests and formatting variations to try and iron out as many problems as possible but it’s unlikely that I tried or spotted everything.

Hopefully someone with more PHP and WordPress experience will be able to improve upon what I’ve been experimenting with, or find a simpler and more elegant solution that retains the useful wpautop functionality while allowing for the use of HTML5 elements in posts. Please share anything you find!