@BP
i am getting this error but its giving only in this book not in other book evan i am using your raw2code.lua file in my command and its working fine in other book but in this book still getting some tags error
here you can check
pandoc -o Functional_Programming_in_C__Second_Edition.epub Functional_Programming_in_C__Second_Edition.md --lua-filter=raw2code.lua
[WARNING] Could not convert TeX math "Entering {op}");       T t = f();       log.LogTrace(, rendering as TeX:
"Entering {op}");       T t = f();      
^
unexpected '"'
expecting "%", "\\label", "\\tag", "\\nonumber", whitespace, "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{", "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*", "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_", "^", "\\left", "\\", "\\hyperref" or end of input
[WARNING] Could not convert TeX math "{s} should be lower case"); Validator<string> ShouldBeOfLength(int n)   => s => (s.Length == n)       ? Valid(s)       : Error(, rendering as TeX:
"{s} should be lower case"); Validator<s
^
unexpected '"'
expecting "%", "\\label", "\\tag", "\\nonumber", whitespace, "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{", "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*", "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_", "^", "\\left", "\\", "\\hyperref" or end of input
[WARNING] Could not convert TeX math "{name} -> {t}"),       onError: ex => WriteLine(, rendering as TeX:
"{name} -> {t}"),       onError: ex => W
^
unexpected '"'
expecting "%", "\\label", "\\tag", "\\nonumber", whitespace, "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{", "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*", "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_", "^", "\\left", "\\", "\\hyperref" or end of input
[WARNING] Could not convert TeX math "Received '{msg}'; Sending 'PING'");   Task.Delay(500).Wait();   pong.Tell("PING"); }); pong = Agent.Start(0, (int count, string msg) => {   int newCount = count + 1;   string nextMsg = (newCount < 5) ? "PONG" : "STOP";   logger.Tell(, rendering as TeX:
"Received '{msg}'; Sending 'PING'");   T
^
unexpected '"'
expecting "%", "\\label", "\\tag", "\\nonumber", whitespace, "\\bangle", "\\brace", "\\brack", "\\choose", "\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle", "{", "\\operatorname", letter, digit, ".", "!", "'", "''", "'''", "''''", "*", "+", ",", "-", ".", "/", ":", ":=", ";", "<", "=", ">", "?", "@", "~", "_", "^", "\\left", "\\", "\\hyperref" or end of input
[WARNING] This document format requires a nonempty <title> element.
Defaulting to 'Functional_Programming_in_C__Second_Edition' as the title.
To specify a title, use 'title' in metadata or --metadata title="...".
PS C:\Users\Hp\Downloads\Compressed
On Friday, February 11, 2022 at 1:06:13 AM UTC+5 BP wrote:
This filter will convert all raw HTML to code in backticks, with syntax highlighting. Save it as raw2code.lua and include --lua-filter=raw2code.lua on the pandoc command line.
local code_for = {
RawInline = pandoc.Code,
RawBlock = pandoc.CodeBlock
}
local function raw2code (elem)
if 'html' == elem.format then
return code_for[elem.tag](elem.text, { class = 'html' })
end
return nil
end
return {
{
RawInline = raw2code,
RawBlock = raw2code
}
}
If you simply want to ignore all raw HTML elements then I think that a lua filter that ignores all RawInlines (perhaps only those with format="html") will work for you. But if some HTML elements need to retain their HTML meaning then more logic will be needed. For example, this document:
% cat raw.md
This is <b>bold</b> text.
gives this HTML:
% pandoc raw.md
<p>This is <b>bold</b> text.</p>
...but with this filter:
% cat raw.lua
function RawInline(raw)
if (raw.format == 'html') then
return {}
end
end
...it gives this:
% pandoc raw.md -L raw.lua
<p>This is bold text.</p>
so before convert to epub file i have to edit md file and find all tags and add these backticks ?
there is no option in pandoc to ignore tags inside book ?
On Thursday, February 10, 2022 at 5:37:27 PM UTC+5 Joost wrote:
On Thu, 10 Feb 2022, at 11:27, mr vicky wrote:
> hello
> i am converting md to epub file but that md file is programming book
> where is some codes written inside but when i convert it to epub then
> its auto detecting these tags and making very bad epub file with page
> breaks and some other kind of coding elements
[...]
> there is any option to ignore programming codes while converting to epub file ?
Note that Markdown allows you to include HTML elements, so whenever you write e.g. <h1> directly, Pandoc assums that's what you're doing and will put an <h1> tag in the html (or epub) output.
You'll want to mark the tags as code, which you can do with backticks: `<h1>`.
HTH
--
Joost Kremers
Life has its moments
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3806ef68-3553-4e8e-8b04-bf7cc4226e7cn%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...@googlegroups.com.