* Pandoc produces code blocks for ePub v2 that is not valid by the ePub checker
@ 2018-09-20 15:12 kiko.fernandez-1zs4UD6AkMk
[not found] ` <2bf5954f-3246-493e-874b-35b45be4ddb4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: kiko.fernandez-1zs4UD6AkMk @ 2018-09-20 15:12 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 1897 bytes --]
Hi there,
I couldn't find this question anywhere, so I hope it has not been answered
before.
The following Markdown doesn't seem to be valid.
BEGIN MD
---
title: This is a test book
---
# Test
This is a test
```python
def test():
return 0
```
END MD
The output error is:
epubcheck-4.0.2 java -jar epubcheck.jar test.epub
Validating using EPUB version 2.0.1 rules.
ERROR(RSC-005): test.epub/EPUB/text/ch001.xhtml(84,151): Error while
parsing file 'attribute "data-line-number" not allowed here; expected
attribute "accesskey", "charset", "coords", "dir", "href", "hreflang",
"lang", "rel", "rev", "shape", "style", "tabindex", "target", "title",
"type" or "xml:lang"'.
ERROR(RSC-005): test.epub/EPUB/text/ch001.xhtml(85,55): Error while parsing
file 'attribute "data-line-number" not allowed here; expected attribute
"accesskey", "charset", "coords", "dir", "href", "hreflang", "lang", "rel",
"rev", "shape", "style", "tabindex", "target", "title", "type" or
"xml:lang"'.
Check finished with errors
epubcheck completed
Basically, from what I can see in the HTML, it generates a line similar to
this one:
<a class="sourceLine" id="cb1-1" data-line-number="1">
and it doesn't seem to be supported.
Do you know how can I remove the data-line-number attribute when I generate
ePub version 2?
Thanks.
--
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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2bf5954f-3246-493e-874b-35b45be4ddb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 3083 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Pandoc produces code blocks for ePub v2 that is not valid by the ePub checker
[not found] ` <2bf5954f-3246-493e-874b-35b45be4ddb4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2018-09-20 16:10 ` John MacFarlane
[not found] ` <m2va70w3om.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: John MacFarlane @ 2018-09-20 16:10 UTC (permalink / raw)
To: kiko.fernandez-1zs4UD6AkMk, pandoc-discuss
Thanks for bringing this to our attention.
The data-line-number attribute is produced by
skylighting (jgm/skylighting on GitHub). The
problem is that although data- attributes are
valid HTML5, they aren't valid HTML4, and epub v2
uses HTML4. (If it works for you to produce
epub3, that would be a solution for now.)
Why don't you put an issue about this on
pandoc's bug tracker (https://github.com/jgm/pandoc/issues),
so we can track it. I'll have to consult with
the person who revised skylighting's treatment
of line numbers. The only workaround I can suggest
for now is to use a script to unpack the epub
container and do a perl or sed substitution in all
the .xhtml files, simply removing the data-line-number
attributes.
kiko.fernandez-1zs4UD6AkMk@public.gmane.org writes:
> Hi there,
>
> I couldn't find this question anywhere, so I hope it has not been answered
> before.
>
> The following Markdown doesn't seem to be valid.
>
> BEGIN MD
>
> ---
> title: This is a test book
> ---
>
> # Test
>
> This is a test
>
> ```python
> def test():
> return 0
> ```
>
> END MD
>
> The output error is:
>
> epubcheck-4.0.2 java -jar epubcheck.jar test.epub
> Validating using EPUB version 2.0.1 rules.
> ERROR(RSC-005): test.epub/EPUB/text/ch001.xhtml(84,151): Error while
> parsing file 'attribute "data-line-number" not allowed here; expected
> attribute "accesskey", "charset", "coords", "dir", "href", "hreflang",
> "lang", "rel", "rev", "shape", "style", "tabindex", "target", "title",
> "type" or "xml:lang"'.
> ERROR(RSC-005): test.epub/EPUB/text/ch001.xhtml(85,55): Error while parsing
> file 'attribute "data-line-number" not allowed here; expected attribute
> "accesskey", "charset", "coords", "dir", "href", "hreflang", "lang", "rel",
> "rev", "shape", "style", "tabindex", "target", "title", "type" or
> "xml:lang"'.
>
> Check finished with errors
>
> epubcheck completed
>
>
> Basically, from what I can see in the HTML, it generates a line similar to
> this one:
>
> <a class="sourceLine" id="cb1-1" data-line-number="1">
>
> and it doesn't seem to be supported.
> Do you know how can I remove the data-line-number attribute when I generate
> ePub version 2?
>
> Thanks.
>
> --
> 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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2bf5954f-3246-493e-874b-35b45be4ddb4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Pandoc produces code blocks for ePub v2 that is not valid by the ePub checker
[not found] ` <m2va70w3om.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
@ 2018-09-20 16:28 ` kiko.fernandez-1zs4UD6AkMk
0 siblings, 0 replies; 3+ messages in thread
From: kiko.fernandez-1zs4UD6AkMk @ 2018-09-20 16:28 UTC (permalink / raw)
To: pandoc-discuss
[-- Attachment #1.1: Type: text/plain, Size: 3892 bytes --]
Hi,
thanks for your prompt response.
I will file an issue tonight. I found that another work around is
to use the option --no-highlight which seems to remove the data attribute.
Thanks
On Thursday, September 20, 2018 at 6:10:17 PM UTC+2, John MacFarlane wrote:
>
>
> Thanks for bringing this to our attention.
>
> The data-line-number attribute is produced by
> skylighting (jgm/skylighting on GitHub). The
> problem is that although data- attributes are
> valid HTML5, they aren't valid HTML4, and epub v2
> uses HTML4. (If it works for you to produce
> epub3, that would be a solution for now.)
>
> Why don't you put an issue about this on
> pandoc's bug tracker (https://github.com/jgm/pandoc/issues),
> so we can track it. I'll have to consult with
> the person who revised skylighting's treatment
> of line numbers. The only workaround I can suggest
> for now is to use a script to unpack the epub
> container and do a perl or sed substitution in all
> the .xhtml files, simply removing the data-line-number
> attributes.
>
>
> kiko.fe...-1zs4UD6AkMk@public.gmane.org <javascript:> writes:
>
> > Hi there,
> >
> > I couldn't find this question anywhere, so I hope it has not been
> answered
> > before.
> >
> > The following Markdown doesn't seem to be valid.
> >
> > BEGIN MD
> >
> > ---
> > title: This is a test book
> > ---
> >
> > # Test
> >
> > This is a test
> >
> > ```python
> > def test():
> > return 0
> > ```
> >
> > END MD
> >
> > The output error is:
> >
> > epubcheck-4.0.2 java -jar epubcheck.jar test.epub
> > Validating using EPUB version 2.0.1 rules.
> > ERROR(RSC-005): test.epub/EPUB/text/ch001.xhtml(84,151): Error while
> > parsing file 'attribute "data-line-number" not allowed here; expected
> > attribute "accesskey", "charset", "coords", "dir", "href", "hreflang",
> > "lang", "rel", "rev", "shape", "style", "tabindex", "target", "title",
> > "type" or "xml:lang"'.
> > ERROR(RSC-005): test.epub/EPUB/text/ch001.xhtml(85,55): Error while
> parsing
> > file 'attribute "data-line-number" not allowed here; expected attribute
> > "accesskey", "charset", "coords", "dir", "href", "hreflang", "lang",
> "rel",
> > "rev", "shape", "style", "tabindex", "target", "title", "type" or
> > "xml:lang"'.
> >
> > Check finished with errors
> >
> > epubcheck completed
> >
> >
> > Basically, from what I can see in the HTML, it generates a line similar
> to
> > this one:
> >
> > <a class="sourceLine" id="cb1-1" data-line-number="1">
> >
> > and it doesn't seem to be supported.
> > Do you know how can I remove the data-line-number attribute when I
> generate
> > ePub version 2?
> >
> > Thanks.
> >
> > --
> > 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 <javascript:>.
> > To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> <javascript:>.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/2bf5954f-3246-493e-874b-35b45be4ddb4%40googlegroups.com.
>
> > For more options, visit https://groups.google.com/d/optout.
>
--
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-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/637497fa-9bd6-44fa-83eb-16242c1548c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #1.2: Type: text/html, Size: 7042 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-20 16:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 15:12 Pandoc produces code blocks for ePub v2 that is not valid by the ePub checker kiko.fernandez-1zs4UD6AkMk
[not found] ` <2bf5954f-3246-493e-874b-35b45be4ddb4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2018-09-20 16:10 ` John MacFarlane
[not found] ` <m2va70w3om.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2018-09-20 16:28 ` kiko.fernandez-1zs4UD6AkMk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).