Skip to main content
deleted 2 characters in body
Source Link

starting from tarleb's answer, you might be able to handle markdown in the html block with the filter:

function RawBlock (raw) if raw.format:match 'html' then blocks = pandoc.read(raw.text, 'html').blocks for i = 1, #blocks do blocks[i] = pandoc.walk_block(blocks[i], { SoftBreak = function(el) return pandoc.Str("\n\n""\n") end, Plain = function(el) return pandoc.read(pandoc.utils.stringify(el), 'markdown').blocks end } ) end return blocks end return raw end 

the same way, markdown_in_html_blocks needs to be disabled:

pandoc --lua-filter=parse-html.lua --from=markdown-markdown_in_html_blocks ... 

starting from tarleb's answer, you might be able to handle markdown in the html block with the filter:

function RawBlock (raw) if raw.format:match 'html' then blocks = pandoc.read(raw.text, 'html').blocks for i = 1, #blocks do blocks[i] = pandoc.walk_block(blocks[i], { SoftBreak = function(el) return pandoc.Str("\n\n") end, Plain = function(el) return pandoc.read(pandoc.utils.stringify(el), 'markdown').blocks end } ) end return blocks end return raw end 

the same way, markdown_in_html_blocks needs to be disabled:

pandoc --lua-filter=parse-html.lua --from=markdown-markdown_in_html_blocks ... 

starting from tarleb's answer, you might be able to handle markdown in the html block with the filter:

function RawBlock (raw) if raw.format:match 'html' then blocks = pandoc.read(raw.text, 'html').blocks for i = 1, #blocks do blocks[i] = pandoc.walk_block(blocks[i], { SoftBreak = function(el) return pandoc.Str("\n") end, Plain = function(el) return pandoc.read(pandoc.utils.stringify(el), 'markdown').blocks end } ) end return blocks end return raw end 

the same way, markdown_in_html_blocks needs to be disabled:

pandoc --lua-filter=parse-html.lua --from=markdown-markdown_in_html_blocks ... 
added 2 characters in body
Source Link

starting from tarleb's answer, you might be able to handle markdown in the html block with the filter:

function RawBlock (raw) if raw.format:match 'html' then blocks = pandoc.read(raw.text, 'html').blocks for i = 1, #blocks do blocks[i] = pandoc.walk_block(blocks[i], { SoftBreak = function(el) return pandoc.Str("\n""\n\n") end, Plain = function(el) return pandoc.read(pandoc.utils.stringify(el), 'markdown').blocks end } ) end return blocks end return raw end 

the same way, markdown_in_html_blocks needs to be disabled:

pandoc --lua-filter=parse-html.lua --from=markdown-markdown_in_html_blocks ... 

starting from tarleb's answer, you might be able to handle markdown in the html block with the filter:

function RawBlock (raw) if raw.format:match 'html' then blocks = pandoc.read(raw.text, 'html').blocks for i = 1, #blocks do blocks[i] = pandoc.walk_block(blocks[i], { SoftBreak = function(el) return pandoc.Str("\n") end, Plain = function(el) return pandoc.read(pandoc.utils.stringify(el), 'markdown').blocks end } ) end return blocks end return raw end 

the same way, markdown_in_html_blocks needs to be disabled:

pandoc --lua-filter=parse-html.lua --from=markdown-markdown_in_html_blocks ... 

starting from tarleb's answer, you might be able to handle markdown in the html block with the filter:

function RawBlock (raw) if raw.format:match 'html' then blocks = pandoc.read(raw.text, 'html').blocks for i = 1, #blocks do blocks[i] = pandoc.walk_block(blocks[i], { SoftBreak = function(el) return pandoc.Str("\n\n") end, Plain = function(el) return pandoc.read(pandoc.utils.stringify(el), 'markdown').blocks end } ) end return blocks end return raw end 

the same way, markdown_in_html_blocks needs to be disabled:

pandoc --lua-filter=parse-html.lua --from=markdown-markdown_in_html_blocks ... 
Source Link

starting from tarleb's answer, you might be able to handle markdown in the html block with the filter:

function RawBlock (raw) if raw.format:match 'html' then blocks = pandoc.read(raw.text, 'html').blocks for i = 1, #blocks do blocks[i] = pandoc.walk_block(blocks[i], { SoftBreak = function(el) return pandoc.Str("\n") end, Plain = function(el) return pandoc.read(pandoc.utils.stringify(el), 'markdown').blocks end } ) end return blocks end return raw end 

the same way, markdown_in_html_blocks needs to be disabled:

pandoc --lua-filter=parse-html.lua --from=markdown-markdown_in_html_blocks ...