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
I have been doing simple tasks with Pandoc for some time, but now I need to tackle something more challenging.
I have a file in RTF format.
Step 1: is to convert it to HTML
Now I want to chunk the HTML at level 1 headings, but the problem is the headings are not defined by a <h1></h1> tags but by <p><strong></strong></p>.
Step 2: Edit the HTML in a text editor replacing <strong></strong> by <h1></h1>.
Step 3: Run Pandoc with -t chunkedhtml
How can I eliminate the use of the manual text editing step? Using a Lua filter in Pandoc, may be? My Lua filter needs to be able to find the sequence <p><strong>...</strong></p> and replace it with <h1>...</h1>. The Lua filter guide doesn't seem to give an example of how to find a sequence of html tags or the syntax to replace them.
Is it possible to get all the way from the RTF file to my chunked final output by concatenating the Pandoc commands?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have been doing simple tasks with Pandoc for some time, but now I need to tackle something more challenging.
I have a file in RTF format.
Step 1: is to convert it to HTML
Now I want to chunk the HTML at level 1 headings, but the problem is the headings are not defined by a
<h1></h1>
tags but by<p><strong></strong></p>
.Step 2: Edit the HTML in a text editor replacing
<strong></strong>
by<h1></h1>
.Step 3: Run Pandoc with -t chunkedhtml
How can I eliminate the use of the manual text editing step? Using a Lua filter in Pandoc, may be? My Lua filter needs to be able to find the sequence
<p><strong>...</strong></p>
and replace it with<h1>...</h1>
. The Lua filter guide doesn't seem to give an example of how to find a sequence of html tags or the syntax to replace them.Is it possible to get all the way from the RTF file to my chunked final output by concatenating the Pandoc commands?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions