Skip to content

Commit b035246

Browse files
author
Corey White
committed
Updated pandoc format and extension
1 parent 81820d0 commit b035246

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

utils/grass_html2md.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ process_file() {
5151
sed 's#<div class="code"><pre>#<pre><code>#g' | \
5252
sed 's#</pre></div>#</code></pre>#g' | \
5353
pandoc -f html-native_divs-native_spans \
54-
-t markdown --wrap=none --atx-headers \
54+
-t gfm+pipe_tables --wrap=none \
5555
--lua-filter "${UTILSPATH}/pandoc_codeblock.lua" | \
5656
sed 's/``` {#sh}/```sh/' | sed 's+ \\\$+ \$+g' | sed 's+%20+-+g' > "${f%%.html}.md"
5757

utils/pandoc_codeblock.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ local MAX_LINE_LENGTH = 120 -- Adjust as needed for MD013
77

88
local LIST_INDENT = ""
99

10+
function Str(el)
11+
local text = el.text:gsub("%s+$", "") -- Remove trailing spaces
12+
return pandoc.Str(text)
13+
end
14+
1015
function RawInline(el)
1116
-- Convert <em> to Markdown italics, and handle special characters
1217
if el.format == "html" then
@@ -134,10 +139,6 @@ function Table(el)
134139
return el
135140
end
136141

137-
function Str(el)
138-
local text = el.text:gsub("%s+$", "") -- Remove trailing spaces
139-
return pandoc.Str(text)
140-
end
141142

142143
function Header(el)
143144
return pandoc.Header(el.level, el.content) -- Ensure ATX-style headers

0 commit comments

Comments
 (0)