convert_pelements: Insert <div>s in front of <p>s

Description Usage Arguments Details Value Examples

Description

pandoc converts HTML to Markdown in part by inserting newlines where there are <p> (</p>) elements in HTML. When those <p> elements are refined by a class specification then formatting is lost.

Usage

1

Arguments

html

The HTML whose <p>-elements will be converted

Details

To keep the class details, this function inserts a <div> behind each <p>. As a result, HTML such as:

<p class="newstyle">This is a p-element.</p>

becomes

<p><div class="newstyle">This is a p-element</div></p>,

which then becomes

\n<div class="newstyle">This is a p-element</div>\n

after conversion to markdown and retains the information in class "newstyle".

Value

An updated html page with <p><div>...</div></p>

Examples

1
2
html <- <p class="newstyle">This is a p-element.</p>
convert_pelements(html)

jacob-ogre/gdoc2rmd documentation built on May 18, 2019, 8:01 a.m.